Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts and javaScripts

 
sudharshan tettu
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi experts...

how to get value of a form element on a struts page...inside java script.

for example..
<html:text property="loginName" />

how to get the value of login name that a user entered...in javaScript

document.loginName.value works??? or is there some other way to do it..
pls help
 
Pranav Sharma
Ranch Hand
Posts: 258
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could use,
window.forms[0].loginName.value

or

window.formName.loginName.value
 
sudharshan tettu
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi pranav

i tried formName.loginname.value as you said but thats not working..

thanks for your quick reply
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic