• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

passing form parameters such us textfield values using url tag

 
Ankur Premi
Greenhorn
Posts: 17
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Help me to pass form parameters such us textfield values using url tag....

How to populate param tag using javascript ?



 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why wouldn't you just use hidden fields?
 
Richard Golebiowski
Ranch Hand
Posts: 213
Eclipse IDE Java Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you view the source of the html that is generated by the Struts tags you will see that the href in the anchor tag is filled in by what is specified in the referenced Struts url tag. So what you could do is append your text field information onto the anchor tags href.

Here is a simple example:
 
Ankur Premi
Greenhorn
Posts: 17
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
actually need to pass all the values stated in my program to the action class. and i have to send the value of the textfield to the action class.

when i try to pass the values through url...i am not able to pass the textfield value

and when i try to pass the value of the textfield ... i am not able to pass the values through url...

i tried using hidden form field for passing the the value of textfield but it did not worked for me..
 
Ankur Premi
Greenhorn
Posts: 17
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have changed the code as...


 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ankur Premi wrote:i tried using hidden form field for passing the the value of textfield but it did not worked for me..

Please see ItDoesntWorkIsUseless.

If it didn't work, chances are you did something wrong: it's a single form with your textfield and all the hidden ones you're trying to send in the URL now. What happened? How did you implement it?

I don't really understand the onclick handler you posted above. Also please take care when posting wide source; it makes reading messages rather difficult, as it forces horizontal scrolling.
 
Richard Golebiowski
Ranch Hand
Posts: 213
Eclipse IDE Java Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
David is right. Although you could pass the text field information as a parameter, the right thing to do would be to figure out why your not getting the field value back.
 
Ankur Premi
Greenhorn
Posts: 17
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you everyone who helped me. I was able to pass the textfield value using javascript





By calling this function onclick of href.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic