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>
 
Ad

Advertisements

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
 
Ad

Advertisements

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>

.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

checkbox 1
Checkbox checks other checkboxes? 1
Checkbox and optionbutton 1
Checkbox validation 4
Multiple Checkboxes 6
Checkbox group 3
Checkbox, I agree 2
Adding multiple checkbox values 1

Top