you shouldn't even need the onClick or submit_db()
Main Topics
Browse All Topicshi everyone!
the problem is that i want to call a servlet from a java script code ..
in the jav script i've written the function which is called on the onclick event of submit button.
iam not able to to get my servlet page from that function call.
plz help me out .
the code is like this..
<script>
function submit_db()
{
}
</script>
<input type="submit" value="Submit" onClick ="submit_db()" name="B2">
what do i write in the function submit_db() to call my servlet
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Well if you have a form with some Input values wich you want to send to your servlet you should put and Action on the form pointing to the servlet and then call the submit() from the script as thanassis said.
If you just want to call the servlet with no form just make your validations on the script and redirect the URL from the script:
<script>
fuction sendRedirect() {
//Validations
.....
//Redirection
Document.location.href="yo
}
</script>
Have fun
Javier
This question has been classified abandoned. I will make a recommendation to the
moderators on its resolution in a week or two. I appreciate any comments
that would help me to make a recommendation.
<note>
Unless it is clear to me that the question has been answered I will recommend delete. It is possible that a Grade less than A will be given if no expert makes a case for an A grade. It is assumed that any participant not responding to this request is no longer interested in its final disposition.
</note>
If the user does not know how to close the question, the options are here:
http://www.experts-exchang
Cd&
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
Split between jarasa and thanassis
Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
Programming_Gal
EE Cleanup Volunteer
Business Accounts
Answer for Membership
by: thanassisPosted on 2003-04-01 at 05:30:36ID: 8245553
put an action at your form e.g:
<form name="form1" method="post" action="step2.jsp">
...
<input type="submit" value="Submit" onClick ="submit_db()" name="B2">
...
and in your script
<script>
function submit_db()
{
document.form1.submit();
return true;
}
</script>