View Full Version : Changing Value of Checkbox on submission

03-13-2009, 02:35 PM
Hi Guys

Okay here Is the issue..

I am doing a form which is writing the info to a delimited file, where I am importing the data into CSV.

Now..to keep all the fields consistant with the headers everytome I copy it over, I need to have the data that is not required filled in automatically. I have done this, but I have an opt-in marketing box and need it to submit a value if the form is submitted and the box is left unticked.

Here is where I am so far:

if (app100.NoMarketing.checked == false){
app100.NoMarketing.checked.value = "Yes Marketing";

Anyone go any ideas?

Thanks in advance

Philip M
03-13-2009, 03:43 PM
The value of a checkbox can only be submitted if the box is checked.

If you want to submit some value regardless, you should use two radio buttons "Yes" and "No" (hopefully with "No" the default).

"To get back my youth I would do anything in the world, except take exercise, get up early, or be respectable." - Oscar Wilde (Irish Poet, Novelist, Dramatist and Critic, 1854-1900)

03-13-2009, 04:17 PM
Cool .. I h thought I was stretching it a bit


Will go for that option:thumbsup: