Checkbox Question...

1

116

I am attempting to use a checkbox to populate a hiden field based on checked
or unchecked. Having an issue with the script. Can someone take a look?

Thanks
David

<script>
function ifchecked01()
{
with (document.forms[0])
{
if (agen_RECUR.value == '')
hdnRECUR.value = "Open";
else (agen_RECUR.value = "ON")
hdnRECUR.value = "Recurring";
}
}
</script>
 
J

Jon Spivey

Hi,
We just need to establish is the box is checked with the checkboxes handy
checked property -

document.forms[0].hdnRECUR.value=(agen_RECUR.checked)?'Recurring':'Open';

Cheers,
Jon
 
1

116

Sweet. Thanks Jon. First time dealing with checkboxes

David

Jon Spivey said:
Hi,
We just need to establish is the box is checked with the checkboxes handy
checked property -

document.forms[0].hdnRECUR.value=(agen_RECUR.checked)?'Recurring':'Open';

Cheers,
Jon

116 said:
I am attempting to use a checkbox to populate a hiden field based on
checked
or unchecked. Having an issue with the script. Can someone take a look?

Thanks
David

<script>
function ifchecked01()
{
with (document.forms[0])
{
if (agen_RECUR.value == '')
hdnRECUR.value = "Open";
else (agen_RECUR.value = "ON")
hdnRECUR.value = "Recurring";
}
}
</script>


.
 
Top