popup - where to put confirm pop up for mootools validation -


where can put confirm popup mootools validation tool

confirm script:

if (confirm('have reviewed information?')) { }

mootools script:

<script type="text/javascript">      window.addevent('domready', function(){          // elements used.         var myform = document.id('leadform'),             myresult = document.id('myresult');          // labels on inputs.         myform.getelements('[type=text], textarea, select' ).each(function(el){             new overtext(el);         });          // validation.         new form.validator.inline(myform);          // ajax (integrates validator).         new form.request(leadform, myresult, {             requestoptions: {                 'spinnertarget': myform             },             extradata: { // make example work.                 'html': 'form sent.'             }         });      });     </script> 

where can put confirmation before sending form popup alert user yes no answer?

try this:

$('myform').addevent('submit', function (event) {     event.preventdefault();     if (confirm('have reviewed information?')) {                     //code if true     }else{ return false;} }); 

this add event listener when form submitting call function inside it.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -