• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

trying to submit a form using hyperlink (href)

 
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 ... ???
 
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 ???
 
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
 
My, my, aren't you a big fella. Here, have a tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!