Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I've tested your code and it works in Chrome, IE 8 and Mozilla Firefox. Check whether in your whole page there is an element which contains in it's <strong>name attribute</strong> value the word <strong>submit</strong>. If there is rename it. For example an input tag like this: <code>&lt;input type="submit" name="submit" value="Submit Form"/&gt;</code> will cause the error appeared in your Mozilla Firebug.</p> <p>Furthermore below you can find an alternative solution.</p> <p>The following solution has been successfully tested in Chrome, IE 8 and Mozilla Firefox. </p> <p><strong>Alternative Solution</strong></p> <blockquote> <p>Retrieve the post URL and the data that you want to post and perform a post in the success callback.</p> </blockquote> <p>The following implementation has been <strong>successfully tested in Chrome, IE 8 and Mozilla Firefox</strong>. In the success callback, the data to be posted is retrieved and posted to the URL and the result is put to a div with id <em>result</em>. You can modify it in order to fit your needs.</p> <pre><code>$(document).ready(function() { $('#form1').submit(function(){ var name = $('#shelf_name').val(); if(name == '') { alert('Shelf name is required'); $('#shelf_name').focus(); } else { $.ajax({ type:'post', url:'check-duplicate-shelf-name.php', data:{'name':name}, context:this, success:function(data) { if(data == 'stop') { alert('Shelf name already exists'); } else { alert('else working?'); //this.submit(); //$(this).submit(); // get the post url and the data to be posted var $form = $(this); shelfNameVal = $form.find( 'input[id="shelf_name"]' ).val(), url = $form.attr( 'action' ); // Send the form data and put the results in the result div $.post(url, { shelf_name: shelfNameVal }, function(data) { $( "#result" ).empty().append(data); } ); } } }); } return false; }); }); </code></pre> <p>I hope this helps.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload