i have a submit button that when selected, will call the function verifySave(). VerifySave will confirm with a popup. echo '<INPUT TYPE=submit VALUE="Save" NAME="generic_savebutton" ONCLICK="verifySave()"/>'; PHP: <SCRIPT LANGUAGE="Javascript" TYPE="text/javascript"> function verifySave() { msg = "Are you sure you want to save this data?"; return confirm(msg); } Code (markup): I need to know the syntax on how to check the return value from the verifySave() method. If user selects ok, i need to set a $_SESSION variable. Anyone help?
Not really a PHP question, but here you go! // form... echo "<input type='hidden' value='0' id='set_this' name='set_this' />"; echo "<input type='submit' value='Save' name='generic_savebutton' onclick=\"fire('set_this');\" />"; Code (markup): // js <script type='text/javascript'> <!--// function fire(el) { if ( confirm( 'Are you sure you want to save this data?' ) ) { document.getElementById(el).value = 1; return ( true ); } else { return ( false ); } } // --> </script> Code (markup): jb