File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes How to submit a form ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "How to submit a form ?" Watch "How to submit a form ?" New topic

How to submit a form ?

Anu satya
Ranch Hand

Joined: Mar 17, 2005
Posts: 146
Hi, I have a problem in submiting the form.
there is a condition. IF that condition is satisfied, then form has to be submitted to next page otherwise, the form has to be submitted to the same page. How do i do that ? my code is as follows:

in the above code, on click of submit button, given condition (say value of a textbox is equal to a 999 or not.)has to be checked. if condition is true, submit the page to confirm.html otherwise, submit the page to same form2.html.

How do i do it? can anyone help me ?
Thanks for your time and help

With Regards,
Amol Fuke
Ranch Hand

Joined: Apr 08, 2005
Posts: 129
Write a javascript function on onClick event of submit button and then check for the condition in that function.Then forward/submit the page depending upon your condition.
For how to write javascript function,do little bit of googling.

"There are no mistakes, only lessons"
I agree. Here's the link:
subject: How to submit a form ?
Similar Threads
Loading multiple forms in single jsp
Multiple form with one action
retreiving request parameter of second frame in first
Multiple Submit button in one jsp
how to load the same jsp page and set user id to 0 when checkbox is selected