Hi
I would like to a confirm and/or an alert box on my page. I will post my code below, just can't figure out why it doesn't work .. very new to javascript.
<HEAD>
<SCRIPT>
<!--- Hide script from old browsers
function validate(f)
{
if (confirm("Are you sure?")
alert("Deleted"
else
alert("Please come back again."
}
// end hiding from old browsers -->
</SCRIPT><BR>
</head>
and then .. I want to use an onClick event to trigger ..
<input type="button" value="Delete" name="B2" onClick="validate(this.form)">
I end up with two error messages .. the first one for line
if (confirm("Are you sure?") .. error saysInvalid Character
Second message in on the onClick line .. Object Expected
I am sure this is an easy problem, I know that when someone is kind enough to help me, I will just look and say duhhhh! (mind not functioning today - it IS friday, after all!!
Any help in this is greatly appreciated!
[sig][/sig]
I would like to a confirm and/or an alert box on my page. I will post my code below, just can't figure out why it doesn't work .. very new to javascript.
<HEAD>
<SCRIPT>
<!--- Hide script from old browsers
function validate(f)
{
if (confirm("Are you sure?")
alert("Deleted"
else
alert("Please come back again."
}
// end hiding from old browsers -->
</SCRIPT><BR>
</head>
and then .. I want to use an onClick event to trigger ..
<input type="button" value="Delete" name="B2" onClick="validate(this.form)">
I end up with two error messages .. the first one for line
if (confirm("Are you sure?") .. error saysInvalid Character
Second message in on the onClick line .. Object Expected
I am sure this is an easy problem, I know that when someone is kind enough to help me, I will just look and say duhhhh! (mind not functioning today - it IS friday, after all!!
Any help in this is greatly appreciated!
[sig][/sig]