Skip navigation
Goalie35_33
Currently Being Moderated

Unable to submit form that contains javascript validation

May 22, 2012 10:58 PM

Tags: #javascript #validation #dreamwaever

Hello.  I don't normally work in dreamweaver (so I apologize if I'm not explaining the issue correctly) but a co-worker developed an html form in dreamweaver which is having issues submitting. 

 

The form contains javascript validation (which appears to be done in form.js).  The validation works correctly, however when I click the Submit button, nothing happens (it should redirect to a different page).  If I remove the javascript validation, the page redirects successfully.

 

Here's the submit button:

<a data-type="submit" class="button" href="thanks.html">send</a>

 

Has anyone experienced this error before or know of anything in dreamweaver that would prevent a form from being submitted when javascript validation is included?

 

Thanks.

 
Replies
  • Currently Being Moderated
    May 23, 2012 12:17 AM   in reply to Goalie35_33

    Normally a submit button look s like

    <input name="submit_x" type="submit" value="Send">
    unless there is an element that triggers a JS code that consequently submits the form.

     

    Gramps

     
    |
    Mark as:
  • Currently Being Moderated
    May 23, 2012 10:29 AM   in reply to Goalie35_33

    The code you provided is a simple link to the page thanks.html. As such, there is nothing wrong with it except that a link like that will not pass the data from a form.

     

    "data-submit' is using the new HTML5 developer-defined data attribute. I'm not sure it is used correctly here.

     

    Whether or not the code snippit is correct, the one line you provided isn't enough to see what's going on. You should probably provided the whole code,

     

    A form is wrapped in a submit button, like the code Gramps provided, and a form action pair of tags. The basic structure is like this:

     

    <form action='thanks.html' method='post'>

    Your Name: <input name='name' type='text'/>

    <input type ='submit' name='submit'/>

    </form>

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points