Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

trying to submit a form using hyperlink (href)

 
Songezo Nkukwana
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, am not being successful in submitting values of a radio button after clicking a link with the help of JavaScript

parts of jsp code


The <a href> part (link) does two things ...
1. Submits the 4 params to the action class
2. Attempts to submit the form (which has a selected radio button) using the following JavaScript


postId is a property of the form bean (searchForm) accessible to this JSP, and i have postId set as a hidden property

In my action class, form.getPostId() is always 0 ... ???
 
Dawn Charangat
Ranch Hand
Posts: 249
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You missed a semi-colon [;] in line number 09.
 
Songezo Nkukwana
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dawn Charangat wrote:You missed a semi-colon [;] in line number 09.


Thought that was optional in Javascript ???
 
Lei Guoguo
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

you can debug like this:
 
Songezo Nkukwana
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But i don't have issues with the debugging, issue is getting the value set to postId within the action class or the actual form bean.. seems to be always 0. But after this line on JavaScript

there value is set successfully alert shows a non 0 value
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic