Help please (php/javascript related issue)

Status
Not open for further replies.

dice

pansy-ass ex-staff member
OP
Former Staff
Joined
Oct 26, 2002
Messages
9,568
Trophies
2
Location
England
XP
1,090
As part of a uni project I'm building a site that includes the use of forms.

What I HAVE to do is include a clear button which when clicked upon confirms if the user wishes to remove all entered info from within the form (prior to its submission - i.e. if they make a typo in multiple fields and wish to re-enter from the beginning).

I know how to do this without the pop-up message, but not with it.

Any help would be much appreciated.

Below are snippets of my code:
CODE*within the body*






*within the head*


function msg()
{
ÂÂÂÂvar ask = confirm('Clear the form?');
ÂÂÂÂ
ÂÂÂÂif (ask)
ÂÂÂÂ{
ÂÂÂÂÂÂÂÂ
ÂÂÂÂ}
ÂÂÂÂ
ÂÂÂÂelse
ÂÂÂÂ{
ÂÂÂÂÂÂÂÂalert('OK, Nothing will be removed.');
ÂÂÂÂ}
}


* edit - I have also tried setting the input type to "reset"
 

dice

pansy-ass ex-staff member
OP
Former Staff
Joined
Oct 26, 2002
Messages
9,568
Trophies
2
Location
England
XP
1,090
thank you tj! it works.
biggrin.gif
 
Status
Not open for further replies.

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    K3Nv2 @ K3Nv2: https://youtube.com/shorts/o4zjzHyB-I0?si=U77XLBb-jVVqtWXz +1