With the registration form of my cake php, once I click on the Submit button, I just want to show the Javascript Confirm dialog box, which should work as follows:
Cake PHP form code:
My JS code: `function confirmfrm submit () { } ` Please tell me, if you have some ideas with it. Thank you! Update: credit for fixing my broken callback See below for details (and not to allow stacko to accept an edit to finalize a big raspberry, answer author.) Using jQuery here The solution is: & lt ;? Php echo $ form-> Create ('Poor', array ('type' = & gt; 'file', 'url' = & gt; '/ register', 'onsubmit' => 'confirmfrmSubmit ();' ')) ;? & Gt;
var agree = confirm (" are you sure Want to continue? "); If (agreed) return is true; Second false return;
& lt ;? Php $ this- & gt; HTML-> Submit script ("jQuery (function ($) {$ ('form.noncompetitor'). Submit (function (event) {if (Confirm ('Are you sure?')) {Return false}}}}} ); ", Array ('inline' = & gt; wrong)); // inline = & gt; I will put this snippet in front of Dome's head. Form- & gt; Make ('non-compact'), array ('type' = & gt; 'file', 'url' = & gt; '/ register', 'default' = & gt; wrong, 'class' = & gt; 'Non-pro' ')); / * Your remaining form * /
Comments
Post a Comment