goon55
asked on
Alert Message/onClick - EASY POINTS
I need assistance with the following function.
<script language="JavaScript">
<!--
function checkFields() {
var form = document.forms[0];
if ((form.RadialButton.value == "Yes")) {
alert("Message to display onClick.")
return false;
}
else {
return true;
}
}
// -->
</script>
<input type="radio" name="RadialButton" value="Yes" onClick="return checkFields()">
When a user clicks this radial button, I have an onClick event calling this function, which displays
the message, which is what I need. But after the user hits OK from the alert, I need the radial button
to stay selected and allow them to continue through the form. Currently, I select the radial button,
get the message, hit OK, then the radial button is unselected. If I try to select it again it does
the same thing. I know I am missing some other command to let the user pass after they have hit OK
from the message, but I have been unable to figure it out. Time is of the essence. (points added for
quick response) Please assist. Thank you.
<script language="JavaScript">
<!--
function checkFields() {
var form = document.forms[0];
if ((form.RadialButton.value == "Yes")) {
alert("Message to display onClick.")
return false;
}
else {
return true;
}
}
// -->
</script>
<input type="radio" name="RadialButton" value="Yes" onClick="return checkFields()">
When a user clicks this radial button, I have an onClick event calling this function, which displays
the message, which is what I need. But after the user hits OK from the alert, I need the radial button
to stay selected and allow them to continue through the form. Currently, I select the radial button,
get the message, hit OK, then the radial button is unselected. If I try to select it again it does
the same thing. I know I am missing some other command to let the user pass after they have hit OK
from the message, but I have been unable to figure it out. Time is of the essence. (points added for
quick response) Please assist. Thank you.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Sorry,
Here's the whole thing:
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE></TITLE>
<SCRIPT LANGUAGE=javascript>
<!--
function checkFields()
{
//var form = document.forms[0];
for (count=0; count<2; count++)
{
if(form.RadialButton[count ].checked)
{
//alert(count);
strValue =form.RadialButton[count]. value;
if(strValue=="Yes")
{
alert("This is the onClick Message!")
return false;
}
else
{
return true;
}
}
}
}
// -->
</script>
</HEAD>
<BODY>
<FORM action="" method=POST id=form name=form>
<input type="radio" name="RadialButton" value="Yes" onClick="JavaScript:checkF ields()">
<input type="radio" name="RadialButton" value="No" onClick="JavaScript:checkF ields()">
</FORM>
</BODY>
</HTML>
Here's the whole thing:
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE></TITLE>
<SCRIPT LANGUAGE=javascript>
<!--
function checkFields()
{
//var form = document.forms[0];
for (count=0; count<2; count++)
{
if(form.RadialButton[count
{
//alert(count);
strValue =form.RadialButton[count].
if(strValue=="Yes")
{
alert("This is the onClick Message!")
return false;
}
else
{
return true;
}
}
}
}
// -->
</script>
</HEAD>
<BODY>
<FORM action="" method=POST id=form name=form>
<input type="radio" name="RadialButton" value="Yes" onClick="JavaScript:checkF
<input type="radio" name="RadialButton" value="No" onClick="JavaScript:checkF
</FORM>
</BODY>
</HTML>
<SCRIPT LANGUAGE=javascript>
<!--
function checkFields()
{
//var form = document.forms[0];
for (count=0; count<2; count++)
{
if(form.RadialButton[count
{
//alert(count);
strValue =form.RadialButton[count].
if(strValue=="Yes")
{
alert("This is the onClick Message!")
return false;
}
else
{
return true;
}
}
}
}
// -->
</script>
Fritz the Blank