It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming JavaScript Forum

Form action help needed!

Form action help needed!

Postby mel1 on Tue Jun 17, 2008 10:41 am

Hi, I am wondering whether it is possible to have two onClick events for the one button in a form. I want to first "saysomething" (as in a message) and once the user clicks okay on the message I would like it to refresh the page.

My code is below but it does not work, can anyone help?

<form action="0">

<input type="button" value="Send Form"
onclick="saySomething('Your form has been sent. Thank-you for your input!')
onClick="window.location.reload()">
</form>

Any help appreciated. Mel
mel1
 
Posts: 6
Joined: Tue Jun 17, 2008 10:32 am

Postby rangana on Wed Jun 18, 2008 2:46 am

Code: Select all
<input type="button" value="Send Form"
onclick="test=confirm('Your form has been sent. Thank-you for your input!'); if(test==true) window.location.reload();else alert('You press Cancel');">
User avatar
rangana
500+ Club
 
Posts: 935
Joined: Wed Feb 27, 2008 5:14 am
Location: Cebu City Philippines

Postby mel1 on Wed Jun 18, 2008 6:37 am

Thank you!
mel1
 
Posts: 6
Joined: Tue Jun 17, 2008 10:32 am

Postby rangana on Wed Jun 18, 2008 6:40 am

You're welcome ;)
User avatar
rangana
500+ Club
 
Posts: 935
Joined: Wed Feb 27, 2008 5:14 am
Location: Cebu City Philippines


Who is online

Users browsing this forum: No registered users and 4 guests