HTML Submit Form - run javascript and ASP JMail script

Posted on 2005-03-23
Medium Priority
Last Modified: 2008-02-01
I have a simple feedback form and I use Javascript to validate the form on submit.  Here is the form tag and a little snippet of the Javascript validation code.

function verifyInput(theForm) {
      if (theForm.company.value == '') {
            alert("Please provide the name of your business organization.");
            return false;
      if (theForm.website.value == '') {
            alert("Please provide the URL of your business organization.");
            return false;
                 and so on.................

'Form tag
<form action="" method="post" name="theForm" id="theForm" onsubmit="return verifyInput(this);">

QUESTION:  Can I still use this Javascript code for validation and if everything is valid, execute a different ASP page that contains the JMail script for mailing the information to me?  In other words, if the form is valid and all required fields inputted - redirect to another ASP page that executes the JMail script.

Thanks in Advance.

Question by:kruegerste
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment

Accepted Solution

Wim_Bl earned 2000 total points
ID: 13614395

you mean like this ?

function verifyInput(theForm) {

     // if everything is valid...
     theForm.action = 'differentPage.asp'

You can even put your submit here, like theForm.submit()


Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question