• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

passing form parameters such us textfield values using url tag

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ?



 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why wouldn't you just use hidden fields?
 
Ranch Hand
Posts: 213
Eclipse IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i have changed the code as...


 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic