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
Post a Comment