Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Dec 2008
    Posts
    23
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Angry Changing Value of Checkbox on submission

    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

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,151
    Thanks
    203
    Thanked 2,548 Times in 2,526 Posts
    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)

  • #3
    New Coder
    Join Date
    Dec 2008
    Posts
    23
    Thanks
    6
    Thanked 0 Times in 0 Posts
    Cool .. I h thought I was stretching it a bit

    Cheers

    Will go for that option


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •