cabron Posted March 16, 2010 Share Posted March 16, 2010 I need help guys with a php form in which I am trying to create a drop down select list on "Product Interested In" but the only thing I see is the number 30, does anyone know what is going on? Link of the page: http://www.ellsworthllc.com/beta/where_to_buy/index.php Link to comment Share on other sites More sharing options...
0 bolerodan Posted March 16, 2010 Share Posted March 16, 2010 I need help guys with a php form in which I am trying to create a drop down select list on "Product Interested In" but the only thing I see is the number 30, does anyone know what is going on? Link of the page: http://www.ellsworthllc.com/beta/where_to_buy/index.php Are you using PHP to generate the form? Looking a tthe source code. I see the <select> block there.. but it has inline CSS styling to not display it. also the number 30 that is displayed is out side of the <select> block so im not sure what you are doing behind the scenes to output that or why its getting outputted. Im assuming your PHP is generating this form. Must be an error in the logic. Without seeing the code cant say much. Link to comment Share on other sites More sharing options...
0 cabron Posted March 16, 2010 Author Share Posted March 16, 2010 Are you using PHP to generate the form? Looking a tthe source code. I see the <select> block there.. but it has inline CSS styling to not display it. also the number 30 that is displayed is out side of the <select> block so im not sure what you are doing behind the scenes to output that or why its getting outputted. Im assuming your PHP is generating this form. Must be an error in the logic. Without seeing the code cant say much. Where did u found the "inline" css? Link to comment Share on other sites More sharing options...
0 jordan. Posted March 16, 2010 Share Posted March 16, 2010 It's your js that is messing it up. Disable your browsers javascript and you will see that it loads correctly. I don't know js so all I can say is try removing each script that you have one by one until you find the culprit. Then work from there. However. I think you have your some HTML problems as well. <label for="product"><strong><span class="blue">*</span>Product interested in: </strong></label> <select name="product" size="1" multiple="multiple" id="product" type="text"> <option>5</option> <option>10</option> <option>20</option> <option>30+</option> </select> Your current settings just gives a really undesirable drop down menu setup. First off. You don't need type="text" here. Next, if you want to allow multiple option selection, then you should really set the size to a number greater than 1 so that you can get the up and down arrows. If you only want to allow one selection in the menu like a normal drop down menu, then you need to remove multiple="multiple" and also size="1" would not be needed either. Link to comment Share on other sites More sharing options...
0 cabron Posted March 16, 2010 Author Share Posted March 16, 2010 Thanks Jordan but I am not either expert in JS, I know the basic like putting a form in a website but trying to figure it out what is going on with the JS, its going to be difficult for me. Anyone with JavaScript knowledge in here? I would appreciate it. Link to comment Share on other sites More sharing options...
0 sweetsam Posted March 16, 2010 Share Posted March 16, 2010 There is a problem with implementation of the nice forms script. They are using a markup combination of p's nested inside a div as a 'standin' for the select menu and javascript then sets the value of the select menu based on your selection. That standin in part is somehow mangled and it is stuck at the end of the page. If you notice there are some numbers towards the left bottom of the page. That is where your select menu is right now. The real select markup is set to display none. Link to comment Share on other sites More sharing options...
0 cabron Posted March 16, 2010 Author Share Posted March 16, 2010 There is a problem with implementation of the nice forms script. They are using a markup combination of p's nested inside a div as a 'standin' for the select menu and javascript then sets the value of the select menu based on your selection. That standin in part is somehow mangled and it is stuck at the end of the page. If you notice there are some numbers towards the left bottom of the page. That is where your select menu is right now. The real select markup is set to display none. Thanks a lot, this is what are you talking about: function replaceSelects() { for(var q = 0; q < selects.length; q++) { //create and build div structure var selectArea = document.createElement('div'); var left = document.createElement('div'); var right = document.createElement('div'); var center = document.createElement('div'); var button = document.createElement('a'); var text = document.createTextNode(selectText); center.id = "mySelectText"+q; var selectWidth = parseInt(selects[q].className.replace(/width_/g, "")); center.style.width = selectWidth - 10 + 'px'; selectArea.style.width = selectWidth + selectRightSideWidth + selectLeftSideWidth + 'px'; button.style.width = selectWidth + selectRightSideWidth + selectLeftSideWidth + 'px'; button.style.marginLeft = - selectWidth - selectLeftSideWidth + 'px'; button.href = "javascript:showOptions("+q+")"; button.onkeydown = selectEvent; button.className = "selectButton"; //class used to check for mouseover selectArea.className = "selectArea"; selectArea.id = "sarea"+q; left.className = "left"; right.className = "right"; center.className = "center"; right.appendChild(button); center.appendChild(text); selectArea.appendChild(left); selectArea.appendChild(right); selectArea.appendChild(center); //hide the select field selects[q].style.display='none'; //insert select div selects[q].parentNode.insertBefore(selectArea, selects[q]); //build & place options div var optionsDiv = document.createElement('div'); optionsDiv.style.width = selectWidth + 1 + 'px'; optionsDiv.className = "optionsDivInvisible"; optionsDiv.id = "optionsDiv"+q; optionsDiv.style.left = findPosX(selectArea) + 'px'; optionsDiv.style.top = findPosY(selectArea) + selectAreaHeight - selectAreaOptionsOverlap + 'px'; //get select's options and add to options div for(var w = 0; w < selects[q].options.length; w++) { var optionHolder = document.createElement('p'); var optionLink = document.createElement('a'); var optionTxt = document.createTextNode(selects[q].options[w].text); optionLink.href = "javascript:showOptions("+q+"); selectMe('"+selects[q].id+"',"+w+","+q+");"; optionLink.appendChild(optionTxt); optionHolder.appendChild(optionLink); optionsDiv.appendChild(optionHolder); //check for pre-selected items if(selects[q].options[w].selected) {selectMe(selects[q].id,w,q);} } //insert options div document.getElementsByTagName("body")[0].appendChild(optionsDiv); } } Link to comment Share on other sites More sharing options...
0 sweetsam Posted March 17, 2010 Share Posted March 17, 2010 I believe so. Wow it doesn't have to be this complex and long. Link to comment Share on other sites More sharing options...
0 cabron Posted March 17, 2010 Author Share Posted March 17, 2010 I believe so. Wow it doesn't have to be this complex and long. Well I downloaded that form, I didn't create it. Now can you tell me please what I need to fix under that code above? Link to comment Share on other sites More sharing options...
0 jordan. Posted March 17, 2010 Share Posted March 17, 2010 Just going to mention. I did some searching for this niceforms script and there is a version 2.0 available. You are running version 1.0. Might be worth trying out the newer version and see how that works out. http://www.emblematiq.com/lab/niceforms/download/ Link to comment Share on other sites More sharing options...
0 cabron Posted March 17, 2010 Author Share Posted March 17, 2010 Thanks a lot Jordan, I will try it out. It has the drop down list menu available which will save me time. Thanks again! Link to comment Share on other sites More sharing options...
Question
cabron
I need help guys with a php form in which I am trying to create a drop down select list on "Product Interested In" but the only thing I see is the number 30, does anyone know what is going on?
Link of the page: http://www.ellsworthllc.com/beta/where_to_buy/index.php
Link to comment
Share on other sites
10 answers to this question
Recommended Posts