Alert and PHP

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
JKM
Forum Contributor
Posts: 221
Joined: Tue Jun 17, 2008 8:12 pm

Alert and PHP

Post by JKM »

<input type="submit" value="Send" onclick="alert('Are you really sure?')" />
1) How can I get a "OK" / "CANCEL" button, instead of just "OK"?
2) If someone is pressing "Send", the php file won't process the information unless they press "OK", right?
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: Alert and PHP

Post by onion2k »

You need a confirm() box instead of alert(). And you need to handle the response properly. Try a search in Google for "javascript confirm".
myismymxd
Forum Newbie
Posts: 5
Joined: Wed May 20, 2009 10:41 am

Re: Alert and PHP

Post by myismymxd »

<form name=thefrm>
<input type="submit" value="Send" onclick="return confrim('Are you really sure?')" />
</form>
press OK will submit the form..
Post Reply