• 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

Populating form values with hyperlink clicks

 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have a doubt regarding ActionForm values being populated and sent in the request when a user clicks on a hyper-link. I have a few hidden values in my jsp page that I'm populating. Clicking on a hyper-link does not seem to pass these values to the Action class. I had to use JavaScript to trigger form submit action when the hyper-link is clicked. If I have a submit button on the page, the values get transferred to the Action class. Why is the behaviour so ? Why do I have to use JavaScript to get this simple process to execute ?
Thanks for the response.

Mallika.
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Links are not inherently part of the form, so they do not submit the form when clicked. Buttons, however, can be part of a form and will submit the form when the button type is "submit".

Since the values on your jsp are hidden (not editable fields), you can add those values to your hyperlinks so that it is not necessary to submit the form when the user clicks the link.
reply
    Bookmark Topic Watch Topic
  • New Topic