powaz Posted May 22, 2007 Share Posted May 22, 2007 i need help with alert... I'm filling form and i need check values like: if($date1>$date2){ echo '<script Language="javaScript"> alert("error"); </SCRIPT> '; } but then alert's the form going to next page ... ? ? i need to stay in same form... and ask for filling textfields correctly. Quote Link to comment https://forums.phpfreaks.com/topic/52500-alert/ Share on other sites More sharing options...
taith Posted May 22, 2007 Share Posted May 22, 2007 then you need to put the javascript on the originating page... php exists only after the page has been submit Quote Link to comment https://forums.phpfreaks.com/topic/52500-alert/#findComment-259059 Share on other sites More sharing options...
per1os Posted May 22, 2007 Share Posted May 22, 2007 You could use AJAX to perform the checks, which would prevent a page reload, but taith is exactly right, if you did not use ajax or javascript to check the data the page will leave and enter into the next page in the process. Quote Link to comment https://forums.phpfreaks.com/topic/52500-alert/#findComment-259088 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.