• 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
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!