Jump to content

Recommended Posts

I have been looking around for two days now but all I find is complicated coding for a simple problem here is what I have come up as far as check boxes, there at 13 but I'll just use a few

<blockquote> 
  <input name="question[]" type="checkbox" value="OrderTotalHigh" />  Order total was higher than I expected  <br />
  <input name="question[]" type="checkbox" value="ShippingHigh" />  Cost of shipping too high  <br />
  <input name="question[]" type="checkbox" value="OutOfStock" />  Products out of stock  <br /> 

what I want to do next is a foreach and get the state of the checkbox and its value that matches the Mysql field and populate the database

Thanks for your help

the way you have your form right now, only the ones that are checked will be posted.  If you want to be able to see that ones are non-checked, you need to explicitly specify element positions for question[] in your form. 

 

example:

question[0]

question[1]

question[2]

 

That way, if the user does not check for instance, "OutOfStock", the 3rd element will still be posted, but be empty

 

You would then have your foreach loop and ... beyond that, you need to be more clear about what it is you're trying to do.

Hello

More definition: it is a 13 question check box form were a customer can choose as many as they like for their reason not to buy. the idea is to gather this info when they exit the website.

<input name="question[]" type="checkbox" value="ChangeMind" />  Changed mind about products  <br />

My idea was The value of each question matches the table field thus as it does a foreach places a 1 or 0, true or false into the field of the database. later the data can be pulled up to show the greatest reason there was no sale. I intend to make the end product a free download at my website http://nilandsplace.com

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.