M
mouac01
I'm new to javascript. I have a form with 2 buttons. I want an alert
to show what button was clicked. Also, is there a way to prevent the
text fields from disappearing after submitting a form? Thanks... CM
<SCRIPT LANGUAGE="JavaScript">
function picked()
{
if(login.value=="1")
{
alert("Yes");
}
if(login.value=="2")
{
alert("No");
}
}
</script>
<form onsubmit="picked()">
<input type="submit" name="login" value="1">
<input type="submit" name="login" value="2">
</form>
to show what button was clicked. Also, is there a way to prevent the
text fields from disappearing after submitting a form? Thanks... CM
<SCRIPT LANGUAGE="JavaScript">
function picked()
{
if(login.value=="1")
{
alert("Yes");
}
if(login.value=="2")
{
alert("No");
}
}
</script>
<form onsubmit="picked()">
<input type="submit" name="login" value="1">
<input type="submit" name="login" value="2">
</form>