webgyrl Posted October 13, 2008 Share Posted October 13, 2008 Hi All! I'm designing an HTML form and I am trying to make it so that a user can select multiple answers in a drop down list. The code I have is this: > <tr valign="top"> <td width="70%" align="right">14.) FRESH Consultants offers Mobile Bookkeeping Services to small businesses. In your opinion, which of these services would help in the growth of your business if contracted to FRESH Consultants? <span class="style3">(Please CTRL or CMD and click on each one that applies to you)</span></td> <td width="40%" align="left"><SELECT NAME="MBS-Services-of-Interest" MULTIPLE SIZE=6 id="MBS-Services-of-Interest"> <option selected="selected">Select all that apply <option value="Bookkeeping & Accounting Services">Bookkeeping & Accounting Services <option value="Payroll Services">Payroll Services <option value="Tax Services">Tax Services <option value="Training Services">Training Services <option value="Financial Analysis">Financial Analysis <option value="Advisory Services">Advisory Services </SELECT> </td> </tr> When the form is sent, I am only getting ONE result back: Mbs Services Of Interest: Training Services I have no idea why this is happening. I tried to also use checkboxes, but same thing, only one item checked is being delivered to me. Any ideas why it's not sending multiple selections? Also, another little thing... I have set the thanks.php to refresh to the home page after form submission. It works in Firefox, but not in IE7? Here is the code I used: ><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta HTTP-EQUIV="REFRESH" CONTENT="3; URL=java script:window.open('http://www[dot]domainname[dot]com','_top');"> <title>MBS Survey</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> Why would it refresh in FF but not in IE? Livesite is here: freshconsultants[dot]com Thanks for any insight you may have! Quote Link to comment Share on other sites More sharing options...
webgyrl Posted October 13, 2008 Author Share Posted October 13, 2008 (edited) I sorted out the refresh deal. I used one sort of JS to do it that didn't seem to include the JS code. It had worked in FF, but there was a conflict in IE, so I ended up using the following and including the JS in the page to solve the issue: ><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="refresh" content="4;url=http://www.freshconsultants.com" target="_top"> <title>MBS Survey</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <script LANGUAGE="javascript"> <!-- if (top.location != location) top.location.href = location.href; //---> </SCRIPT> Still can't figure out the list multiples issue tho! Edited October 13, 2008 by webgyrl Quote Link to comment Share on other sites More sharing options...
OJB Posted October 13, 2008 Share Posted October 13, 2008 I am not sure whether this will work but try naming your select MBS-Services-of-Interest[] With the square brackets at the end then when it has posted it might be an array which you can run through each option selected. Quote Link to comment Share on other sites More sharing options...
webgyrl Posted October 13, 2008 Author Share Posted October 13, 2008 I am not sure whether this will work but try naming your select MBS-Services-of-Interest[] With the square brackets at the end then when it has posted it might be an array which you can run through each option selected. Wow, that worked! Can you explain to me why it worked? Quote Link to comment Share on other sites More sharing options...
OJB Posted October 13, 2008 Share Posted October 13, 2008 Sure By adding [] to the end of the name you are not creating a single element called MBS-Services-of-Interest anymore, you are creating an array called MBS-Services-of-Interest So when you were selecting multiple options before if would only be able to store one of them as MBS-Services-of-Interest and would overwrite any other selections, now instead it can store as many elements as you require.. so it will be MBS-Services-of-Interest[0] = 'first choice' MBS-Services-of-Interest[1] = 'second choice' and so on... Quote Link to comment Share on other sites More sharing options...
webgyrl Posted October 13, 2008 Author Share Posted October 13, 2008 Ah OK, that's very interesting. I thought for some reason that the form script I bought would already have that all programmed into it. I think I'll tell the developer about this as I'm sure I'm not the first to encounter it. Thanks so much for explaining it to me. At least now I know how to do an HTML array. Thanks! Quote Link to comment Share on other sites More sharing options...
OJB Posted October 13, 2008 Share Posted October 13, 2008 No problemo, glad you got it sorted. Good luck with the site! Quote Link to comment Share on other sites More sharing options...
webgyrl Posted October 13, 2008 Author Share Posted October 13, 2008 Thank you so much! Hey Andy... I got your reply... and I see you down there... hope you are well. Have a super day.... I'm off to bed! LOL Quote Link to comment Share on other sites More sharing options...
TCH-Andy Posted October 13, 2008 Share Posted October 13, 2008 I'm fine thanks Nat, OJB had it covered and posted just before me, hence I deleted my reply. I'm glad you have it all sorted Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.