JavaScript - Creating Basic Data-driven Combo Boxes
This is my first posting on this forum so please be gentle
Here is the link to a page on my work web: - http://www.deltaclub.co.uk/businesslinkform.html You will see that I have three combo box objects on this form - one containing dates (Date) and the other two containing times (Time1 & Time2). Each time on each date is an available appointment. I would like the content of the date combos to be read from a file whenever the page is opened - a text file with one record per row would be fine (by way of an example - but this may be insufficient). On the face of it this would seem fairly rudimentary but I don't code in JavaScript of PHP and, having found this site I can make a start. I used to be a VB coder. On each date the following appointment times are available: - 10:00 11:00 12:00 14:00 15:00 This assumes that no appointments on a given day are taken. This leads me to conclude that each date should have records for each time - possibly as a CSV text file as follows: - "29th May 2009","10:00" "29th May 2009","11:00" "29th May 2009","12:00" "29th May 2009","14:00" "29th May 2009","15:00" "14th June 2009","10:00" "14th June 2009","11:00" "14th June 2009","12:00" "14th June 2009","14:00" "14th June 2009","15:00" The second time combo should make unavailable the time selected in the first time combo and present only those times available on the chosen date in the CSV file on the server. When I confirm appointments, at present I have to edit the page objects and update the web - which is quite messy and slow whereas uploading a simple text file, whilst an imperfect solution, is much better than what I currently have. I believe that a PHP or Javascript routine based on events on the three objects would remove the inherent problems and would provide a useful set of building blocks for other routines of a similar nature. The routine would trigger whenever the page is loaded (or refreshed) or the content of any one of the three objects gets or loses the focus or a selection is made in an object. The Date Combo would need to look up the available dates - keeping the currently selected date selected or, if that date is no longer available defaulting to the first date in the list. The user then makes a selection or makes no change to the selected date. The Time1 Combo then reads the available times for that date, retains the currently selected time (if available) or the first available time (if the selected is not available) and the user makes a selection or accepts the current selection. The Time2 Combo does the same as the Time1 Combo and in addition it eliminates the time selected in the Time1 Combo from the available choices. The result is that visitors are only offered available times on available dates (insofar as this solution provides). When the form is submitted I would receive the email and confirm the appointment with the client and, in addition, I would modify and upload the modified data file to the web server using Filezilla. The benefit is that there is a slim to none chance of two people wanting to book the same times on the same date at exactly the same time (though it is possible). In addition, I can add new dates and add new times if there is a demand and I can even add previously deleted times if there is sufficient demand to warrant bringing in a second consultant to take the meetings. I'm aware of the commercial solutions that are available but my boss won't pay for them and having a solution that could be adapted to bolt into any scenario (with suitable code modifications) would be a real asset. Any contribution would be most gratefully accepted. Thank you for reading this. __________________ Kind regards, Martyn Required knowledge increases at a rate exponential to the rate at which knowledge may be acquired. Similar TutorialsHello I'm using the combo box selection menu by Elviro Mirko from this site (http://www.javascriptkit.com/script/...plecombo.shtml) I have made amendments to show my own data, however what I would like to happen is if the user selects from the top combo only, then all the records would be shown, whereas selecting from the second combo merely 'drills down' and shows the records required. - Hope that makes sense. The code is as follows: Code: // first combo box data_1 = new Option("Douglas - DIS", "$"); data_2 = new Option("Douglas - COE", "$$"); data_3 = new Option("Peel - DIS", "$$$"); data_4 = new Option("Peel - COE", "$$$$"); data_5 = new Option("Ramsey - DIS", "$$$$$"); data_6 = new Option("Ramsey - COE", "$$$$$$"); data_7 = new Option("Castletown - DIS", "$$$$$$$"); data_8 = new Option("Castletown - COE", "$$$$$$$$"); // second combo box data_1_1 = new Option("Registry Office Douglas", "-"); data_1_2 = new Option("Broadway Baptist Church Douglas", "-"); data_1_3 = new Option("Finch Hill Congregational Church Douglas", "-"); data_2_1 = new Option("St Thomas's Church", "--"); data_2_2 = new Option("St Barnabas Church", "--"); data_2_3 = new Option("St George's Church", "--"); The HTML code is as follows: Code: <select name="combo0" id="combo_0" onChange="change(this);" style="width:200px;"> <option value="">Select a Register...</option> <option value="Douglas - DIS">Douglas - DIS</option> <option value="Douglas - COE">Douglas - COE</option> <option value="Peel - DIS">Peel - DIS</option> <option value="Peel - COE">Peel - COE</option> <option value="Ramsey - DIS">Ramsey - DIS</option> <option value="Ramsey - COE">Ramsey - COE</option> <option value="Castletown - DIS">Castletown - DIS</option> <option value="Castletown - COE">Castletown - COE</option> </select> <BR><BR> <select name="combo1" id="combo_1" onChange="change(this)" style="width:200px;"> <option value="">Select a venue...</option> </select> the link for the actual site is http://www.manxbmd.com/cgi-bin/db.cg...m;db=marriages If you choose Douglas-COE and search, then 0 records are found, if you choose Douglas-COE followed by St Thomas's then still 0 records are found but if you search the surname Allitson you'll see that there is a record there. I'm not sure where I've gone wrong - I'm completely new to Javascript. Any suggestions welcomed. regards Pendle Hi all, please help... There is a small, but very usability script - Multiple Dynamic Combo Boxes by Elviro Mirko (http://www.javascriptkit.com/script/...plecombo.shtml). Since there are many versions of this script. One of them, which I did. Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title> New Document </title> <script type="text/javascript"> <!-- /* *** Multiple dynamic combo boxes *** by Mirko Elviro, 9 Mar 2005 *** Script featured and available on JavaScript Kit (http://www.javascriptkit.com) *** ***Please do not remove this comment */ // This script supports an unlimited number of linked combo boxed // Their id must be "combo_0", "combo_1", "combo_2" etc. // Here you have to put the data that will fill the combo boxes // ie. data_2_1 will be the first option in the second combo box // when the first combo box has the second option selected // first combo box // data_1 = new Option("All Models", "#"); data_2 = new Option("Model 1", "#"); data_3 = new Option("Model 2", "#"); // second combo box // //All data_1_1 = new Option("All Types", "#"); data_1_2 = new Option("Type 1", "#"); data_1_3 = new Option("Type 2", "#"); //Model 1 data_2_1 = new Option("All Types", "#"); data_2_2 = new Option("Type 1", "#"); data_2_3 = new Option("Type 2", "#"); //Model 2 data_3_1 = new Option("All Types", "#"); data_3_2 = new Option("Type 1", "#"); data_3_3 = new Option("Type 2", "#"); // third combo box // //All Models data_1_1_1 = new Option("All Sizes", "#"); data_1_1_2 = new Option("Size 1", "#"); data_1_1_3 = new Option("Size 2", "#"); data_1_2_1 = new Option("All Sizes", "#"); data_1_2_2 = new Option("Size 1", "#"); data_1_2_3 = new Option("Size 2", "#"); data_1_3_1 = new Option("All Sizes", "#"); data_1_3_2 = new Option("Size 1", "#"); data_1_3_3 = new Option("Size 2", "#"); //Model 1 data_2_1_1 = new Option("All Sizes", "#"); data_2_1_2 = new Option("Size 1", "#"); data_2_1_3 = new Option("Size 2", "#"); data_2_2_1 = new Option("All Sizes", "#"); data_2_2_2 = new Option("Size 1", "#"); data_2_2_3 = new Option("Size 2", "#"); data_2_3_1 = new Option("All Sizes", "#"); data_2_3_2 = new Option("Size 1", "#"); data_2_3_3 = new Option("Size 2", "#"); //Model 2 data_3_1_1 = new Option("All Sizes", "#"); data_3_1_2 = new Option("Size 1", "#"); data_3_1_3 = new Option("Size 2", "#"); data_3_2_1 = new Option("All Sizes", "#"); data_3_2_2 = new Option("Size 1", "#"); data_3_2_3 = new Option("Size 2", "#"); data_3_3_1 = new Option("All Sizes", "#"); data_3_3_2 = new Option("Size 1", "#"); data_3_3_3 = new Option("Size 2", "#"); // fourth combo box // //All Models data_1_1_1_1 = new Option("All color","http://special.link"); data_1_1_1_2 = new Option("Color 1","http://special.link"); data_1_1_1_3 = new Option("Color 2","http://special.link"); data_1_1_2_1 = new Option("All color","http://special.link"); data_1_1_2_2 = new Option("Color 1","http://special.link"); data_1_1_2_3 = new Option("Color 2","http://special.link"); data_1_1_3_1 = new Option("All color","http://special.link"); data_1_1_3_2 = new Option("Color 1","http://special.link"); data_1_1_3_3 = new Option("Color 2","http://special.link"); data_1_2_1_1 = new Option("All color","http://special.link"); data_1_2_1_2 = new Option("Color 1","http://special.link"); data_1_2_1_3 = new Option("Color 2","http://special.link"); data_1_2_2_1 = new Option("All color","http://special.link"); data_1_2_2_2 = new Option("Color 1","http://special.link"); data_1_2_2_3 = new Option("Color 2","http://special.link"); data_1_2_3_1 = new Option("All color","http://special.link"); data_1_2_3_2 = new Option("Color 1","http://special.link"); data_1_2_3_3 = new Option("Color 2","http://special.link"); data_1_3_1_1 = new Option("All color","http://special.link"); data_1_3_1_2 = new Option("Color 1","http://special.link"); data_1_3_1_3 = new Option("Color 2","http://special.link"); data_1_3_2_1 = new Option("All color","http://special.link"); data_1_3_2_2 = new Option("Color 1","http://special.link"); data_1_3_2_3 = new Option("Color 2","http://special.link"); data_1_3_3_1 = new Option("All color","http://special.link"); data_1_3_3_2 = new Option("Color 1","http://special.link"); data_1_3_3_3 = new Option("Color 2","http://special.link"); //All Model 1 data_2_1_1_1 = new Option("All color","http://special.link"); data_2_1_1_2 = new Option("Color 1","http://special.link"); data_2_1_1_3 = new Option("Color 2","http://special.link"); data_2_1_2_1 = new Option("All color","http://special.link"); data_2_1_2_2 = new Option("Color 1","http://special.link"); data_2_1_2_3 = new Option("Color 2","http://special.link"); data_2_1_3_1 = new Option("All color","http://special.link"); data_2_1_3_2 = new Option("Color 1","http://special.link"); data_2_1_3_3 = new Option("Color 2","http://special.link"); data_2_2_1_1 = new Option("All color","http://special.link"); data_2_2_1_2 = new Option("Color 1","http://special.link"); data_2_2_1_3 = new Option("Color 2","http://special.link"); data_2_2_2_1 = new Option("All color","http://special.link"); data_2_2_2_2 = new Option("Color 1","http://special.link"); data_2_2_2_3 = new Option("Color 2","http://special.link"); data_2_2_3_1 = new Option("All color","http://special.link"); data_2_2_3_2 = new Option("Color 1","http://special.link"); data_2_2_3_3 = new Option("Color 2","http://special.link"); data_2_3_1_1 = new Option("All color","http://special.link"); data_2_3_1_2 = new Option("Color 1","http://special.link"); data_2_3_1_3 = new Option("Color 2","http://special.link"); data_2_3_2_1 = new Option("All color","http://special.link"); data_2_3_2_2 = new Option("Color 1","http://special.link"); data_2_3_2_3 = new Option("Color 2","http://special.link"); data_2_3_3_1 = new Option("All color","http://special.link"); data_2_3_3_2 = new Option("Color 1","http://special.link"); data_2_3_3_3 = new Option("Color 2","http://special.link"); //All Model 2 data_3_1_1_1 = new Option("All color","http://special.link"); data_3_1_1_2 = new Option("Color 1","http://special.link"); data_3_1_1_3 = new Option("Color 2","http://special.link"); data_3_1_2_1 = new Option("All color","http://special.link"); data_3_1_2_2 = new Option("Color 1","http://special.link"); data_3_1_2_3 = new Option("Color 2","http://special.link"); data_3_1_3_1 = new Option("All color","http://special.link"); data_3_1_3_2 = new Option("Color 1","http://special.link"); data_3_1_3_3 = new Option("Color 2","http://special.link"); data_3_2_1_1 = new Option("All color","http://special.link"); data_3_2_1_2 = new Option("Color 1","http://special.link"); data_3_2_1_3 = new Option("Color 2","http://special.link"); data_3_2_2_1 = new Option("All color","http://special.link"); data_3_2_2_2 = new Option("Color 1","http://special.link"); data_3_2_2_3 = new Option("Color 2","http://special.link"); data_3_2_3_1 = new Option("All color","http://special.link"); data_3_2_3_2 = new Option("Color 1","http://special.link"); data_3_2_3_3 = new Option("Color 2","http://special.link"); data_3_3_1_1 = new Option("All color","http://special.link"); data_3_3_1_2 = new Option("Color 1","http://special.link"); data_3_3_1_3 = new Option("Color 2","http://special.link"); data_3_3_2_1 = new Option("All color","http://special.link"); data_3_3_2_2 = new Option("Color 1","http://special.link"); data_3_3_2_3 = new Option("Color 2","http://special.link"); data_3_3_3_1 = new Option("All color","http://special.link"); data_3_3_3_2 = new Option("Color 1","http://special.link"); data_3_3_3_3 = new Option("Color 2","http://special.link"); // other parameters displaywhenempty=""; valuewhenempty=-1; displaywhennotempty="-select-"; valuewhennotempty=0; function change(currentbox) { numb = currentbox.id.split("_"); currentbox = numb[1]; i=parseInt(currentbox)+1; // I empty all combo boxes following the current one while (document.getElementById("combo_"+i)) { son = document.getElementById("combo_"+i); // I empty all options except the first one (it isn't allowed) for (m=son.options.length-1; m>0; m--) son.options[m]=null; // I reset the first option son.options[0]=new Option(displaywhenempty,valuewhenempty); i++; } // now I create the string with the "base" name ("stringa"), ie. "data_1_0" // to which I'll add _0,_1,_2,_3 etc to obtain the name of the combo box to fill stringa='data'; i=0; while (document.getElementById("combo_"+i)) { stringa=stringa+'_'+document.getElementById("combo_"+i).selectedIndex; if (i==currentbox) break; i++; } // filling the "son" combo (if exists) following=parseInt(currentbox)+1; if (document.getElementById("combo_"+following)) { son = document.getElementById("combo_"+following); stringa=stringa+"_"; i=0; while ((eval("typeof("+stringa+i+")!='undefined'")) || (i==0)) { // if there are no options, I empty the first option of the "son" combo // otherwise I put "-select-" in it if ((i==0) && eval("typeof("+stringa+"0)=='undefined'")) if (eval("typeof("+stringa+"1)=='undefined'")) son.options[0]=new Option(displaywhenempty,valuewhenempty); else son.options[0]=new Option(displaywhennotempty,valuewhennotempty); else son.options[i]=new Option(eval(stringa+i+".text"),eval(stringa+i+".value")); i++; } //son.focus() i=1; combostatus=''; cstatus=stringa.split("_"); while (cstatus[i]) { combostatus=combostatus+cstatus[i]; i++; } return combostatus; } } function go(elementName){ var newUrl=document.forms[0].elements[elementName].options[document.forms[0].elements[elementName].selectedIndex].value; if(newUrl.indexOf("http://")>=0){//rudamentary url checker! So don't go to a blank page if select box not populated. location.href=newUrl; } } //--> </script> </head> <body> <form> Model: <br /> <select name="combo0" id="combo_0" onChange="change(this);" style="width:200px;"> <option value="value1">-select-</option> <option value="value2">All Models</option> <option value="value3">Model 1</option> <option value="value4">Model 2</option> </select> <br /> Type: <br /> <select name="combo1" id="combo_1" onChange="change(this)" style="width:200px;"> <option value="value1"> </option> </select> <br /> Size: <br /> <select name="combo2" id="combo_2" onChange="change(this);" style="width:200px;"> <option value="value1"> </option> </select> <br /> Color: <br /> <select name="combo3" id="combo_3" onChange="change(this);" style="width:200px;"> <option value="value1"> </option> <br /> <input type="button" value="Go" onclick="go('combo3')"> <!-- could be changed for onchange event handler on select box --> </select> </form> <p align="center"><font face="arial" size="-2">This free script provided by</font><br> <font face="arial, helvetica" size="-2"><a href="http://javascriptkit.com">JavaScript Kit</a></font></p> </body> </html> But I need to when you first start the script immediately showed the first value and its associated down decaying values without - select - immediately show combo first values All Models All Types All Sizes All Сolor (and after next for various behaviors the user's manipulation choice) **Or are there any other JS solutions that satisfy my request I would be grateful for any aid.... Hello, I'm using "Cut & Paste Multiple Dynamic Combo Boxes" script. I want to configure it, so at first only 1st combo box is visible and the rest are hidden and only populate based on the selections. Also, when the last parameter (from the 5th combo box) was selected, I need to show the table with the search results based on the all selected parameters. Here is what I have so far: Code: <script language="JavaScript" type="text/javascript"> <!-- /* *** Multiple dynamic combo boxes *** by Mirko Elviro, 9 Mar 2005 *** Script featured and available on JavaScript Kit (http://www.javascriptkit.com) *** ***Please do not remove this comment */ // This script supports an unlimited number of linked combo boxed // Their id must be "combo_0", "combo_1", "combo_2" etc. // Here you have to put the data that will fill the combo boxes // ie. data_2_1 will be the first option in the second combo box // when the first combo box has the second option selected // first combo box data_1 = new Option("1", "$"); // second combo box data_1_1 = new Option("11", "-"); data_1_2 = new Option("12", "-"); data_1_3 = new Option("13", "-"); // third combo box data_1_1_1 = new Option("111", "*"); data_1_2_1 = new Option("121", "*"); data_1_3_1 = new Option("131", "*"); // fourth combo box data_1_1_1_1 = new Option("1111","%") data_1_1_1_2 = new Option("1112","%") data_1_2_1_1 = new Option("1211","%") data_1_3_1_1 = new Option("1311","%") data_1_3_1_2 = new Option("1312","%") data_1_3_1_3 = new Option("1313","%") // fifth combo box data_1_1_1_1_1 = new Option("11111","%") data_1_1_1_1_2 = new Option("11112","%") data_1_1_1_2_1 = new Option("11121","%") data_1_1_1_2_2 = new Option("11122","%") data_1_1_1_2_3 = new Option("11123","%") data_1_1_1_2_4 = new Option("11124","%") data_1_2_1_1_1 = new Option("12111","%") data_1_3_1_1_1 = new Option("13111","%") data_1_3_1_2_1 = new Option("13121","%") data_1_3_1_2_2 = new Option("13122","%") data_1_3_1_2_3 = new Option("13123","%") data_1_3_1_2_4 = new Option("13124","%") data_1_3_1_2_5 = new Option("13125","%") data_1_3_1_3_1 = new Option("13131","%") data_1_3_1_3_2 = new Option("13132","%") // other parameters displaywhenempty="" valuewhenempty=-1 displaywhennotempty="-select-" valuewhennotempty=0 function change(currentbox) { numb = currentbox.id.split("_"); currentbox = numb[1]; i=parseInt(currentbox)+1 // I empty all combo boxes following the current one while ((eval("typeof(document.getElementById(\"combo_"+i+"\"))!='undefined'")) && (document.getElementById("combo_"+i)!=null)) { son = document.getElementById("combo_"+i); // I empty all options except the first one (it isn't allowed) for (m=son.options.length-1;m>0;m--) son.options[m]=null; // I reset the first option son.options[0]=new Option(displaywhenempty,valuewhenempty) i=i+1 } // now I create the string with the "base" name ("stringa"), ie. "data_1_0" // to which I'll add _0,_1,_2,_3 etc to obtain the name of the combo box to fill stringa='data' i=0 while ((eval("typeof(document.getElementById(\"combo_"+i+"\"))!='undefined'")) && (document.getElementById("combo_"+i)!=null)) { eval("stringa=stringa+'_'+document.getElementById(\"combo_"+i+"\").selectedIndex") if (i==currentbox) break; i=i+1 } // filling the "son" combo (if exists) following=parseInt(currentbox)+1 if ((eval("typeof(document.getElementById(\"combo_"+following+"\"))!='undefined'")) && (document.getElementById("combo_"+following)!=null)) { son = document.getElementById("combo_"+following); stringa=stringa+"_" i=0 while ((eval("typeof("+stringa+i+")!='undefined'")) || (i==0)) { // if there are no options, I empty the first option of the "son" combo // otherwise I put "-select-" in it if ((i==0) && eval("typeof("+stringa+"0)=='undefined'")) if (eval("typeof("+stringa+"1)=='undefined'")) eval("son.options[0]=new Option(displaywhenempty,valuewhenempty)") else eval("son.options[0]=new Option(displaywhennotempty,valuewhennotempty)") else eval("son.options["+i+"]=new Option("+stringa+i+".text,"+stringa+i+".value)") i=i+1 } //son.focus() i=1 combostatus='' cstatus=stringa.split("_") while (cstatus[i]!=null) { combostatus=combostatus+cstatus[i] i=i+1 } return combostatus; } } //--> </script> <form> <table style="width: 49%"> <tr> <td style="width: 200px">Option 1:</td> <td style="width: 213px"> <select name="combo0" id="combo_0" onChange="change(this);" style="width:200px;"> <option value="none">-select-</option> <option value="1">1</option> </select></td> </tr> <tr> <td style="width: 200px">Option 2:</td> <td style="width: 213px"> <select name="combo1" id="combo_1" onChange="change(this)" style="width:200px;"> <option value=""> </option> </select></td> </tr> <tr> <td style="width: 200px">Option 3:</td> <td style="width: 213px"> <select name="combo2" id="combo_2" onChange="change(this);" style="width:200px;"> <option value=""> </option> </select></td> </tr> <tr> <td style="width: 200px">Option 4:</td> <td style="width: 213px"> <select name="combo3" id="combo_3" onChange="change(this);" style="width:200px;"> <option value=""> </option> </select></td> </tr> <tr> <td style="width: 200px">Option 5:</td> <td style="width: 213px"> <select name="combo4" id="combo_4" onChange="change(this);" style="width:200px;"> <option value=""> </option> </select></td> </tr> </table></form> This script is used in my html page and I don't have a database to choose from. So, I wonder if it's possible to make all these modifications with only html and JavaScript. Any help will be appreciated. Thanks in advance. I would like to create collapsing boxes. I would like for them to have different colors. Box1 Box 3 Link 1 Link 1 Link 2 link 2 Link 3 Link 3 Box2 Box 4 Link 1 Link 1 Link 2 link 2 Link 3 Link 3 I got the code to do the first column (box 1 and 2). But I don't know how to add a second column (box 3 and 4). Any help would be appreciated. Thanks Hi there, basically i have created a simple card game, i have one html page with 6 decks of cards. The decks are just images that when clicked display 6 other cards on another html page. What i want to do is that when i click a card on the second page i want the card to be removed, so that when i go back the first page and select the same deck again, the second page opens and the card i had selected before is still removed? Is this possible with javascript please i am totally new to it. Please could someone give me some direction? Thanks
Hi Everybody This is probably a very commonly asked question, however after much searching online I can't seem to find a straightforward answer. If anyone knows the code or a link to a place with a simple example it would be great. What I have got is a form that a user has to fill out and submit (when validated all variables are stored in a session and emailed after multiple forms are completed), currently I have radio buttons, text boxes and a combo box/ drop down list (for location). All parts are working fine and validating fine. My problem is to do with the combo box//ddl. I have successfully validated the ddl so the user must select a location onsubmit and it is added to session and passed fine. At the moment the ddl only has cities or towns in it however as I would like to include different states and possibly different countries I need a code that validates the state first and then only gives the cities/towns that are in that state (otherwise my ddl would be to large). I can do this with links however I can't seem to do it in a form. I am trying to do it this way DDL has list of all states that on mouseover/ onclick the list is revealed. onclick of a specific state populates another ddl with only the cities cities/ towns that are in that state and onclick of specific city selects the location whereby onsubmit the location is stored in the the session for submission by email Thanks in advance for your help I still have the following two major issues. 1) Firstly I need to be able to send the selection from the second combo box by php. 2) secondly I need the combo box to appear within the table. (I thought this should be easy, but for the life of me cannot figure out how to get the dynamic combo into my table inside the form) I have managed to send the selection from the first combo box with the form and also I can send a selection from the second combo, however onsubmit regardless of what is selected in the second combo box it simply sends the last option not the one selected. I have spent many hours trying to figure out why this is the case to no avail. I have included my code for anyone who may be able to help. Lastly when I have figured out these 2 (with a little help) I should be able to sort out the validation by myself. Please ignore any code that is not relevant <html> <head> <script type="text/javascript"> var this1; window.onload = function() { if (!document.all) document.captureEvents(Event.CHANGE); document.getElementById('myddl').onchange = readDDL1; } function readDDL1() { var ddlobj = document.getElementById('myddl'); var currentSelection = ddlobj.options[ddlobj.options.selectedIndex].value; if (currentSelection == '') currentSelection = ddlobj.options[ddlobj.options.selectedIndex].text; doDDL2(currentSelection); } function doDDL2(ddl1Selection) { var existingDDL2; if ((existingDDL2 = document.getElementById('myddl2')) != null) existingDDL2.parentNode.removeChild(existingDDL2); var ddl2Options; switch (ddl1Selection) { case "Western Australia": ddl2Options = ["Please Select A Location", "Karratha", "Perth"]; break; case "Queensland": ddl2Options = ["Please Select A Location", "Brisbane", "Gold Coast"]; break; } if (typeof ddl2Options == "object") { ddl2 = document.createElement('select'); ddl2.id = "myddl2"; var forVar; for (forVar in ddl2Options) { var newOption = document.createElement('option'); newOption.appendChild(document.createTextNode(ddl2Options[forVar])); ddl2.appendChild(newOption); } document.body.appendChild(ddl2); } document.testform.this1.value = ((ddl2Options[forVar])); } function checkFrequency() { return ShowResults(); } function validate(){ var digits="0123456789" var temp if (document.testform.location.selectedIndex == 0) { alert("Please Select a State"); return false } if (document.testform.location2.selectedIndex == 0) { alert("Please Select a Location"); return false } return true } </script> <style type="text/css"> .td_freq { background-color:yellow; height:40px; text-align:center; } .td_sev { background-colorink; height:40px; text-align:center; } .td_wi { background-color:lightgreen; height:40px; text-align:center; } </style> </head> <body> <FORM name="testform" action='./emlapd.php' method='post' onsubmit="return checkFrequency()"> <input type='hidden' name='this1'> <table align="center" border="1" width="40%"> <tr><td><b>Current Worksite State:</b><font color="red">*</font></td> <td> <select name="location" width='53' id="myddl"> <option value="0">--- Please Select Your State --- & nbs p; & n bsp; & nbs p; </option> <option value="Western Australia">Western Australia</option> <option value="Queensland">Queensland</option> </select> </td></tr> <tr><td><b>Location:</b><font color="red">*</font></td> <td> </td></tr> </table> <tr> <th colspan="2"> <input type="submit" name='submit' value="Submit" onclick= "return validate()"> </th> <td colspan="10"> </td> <th> <input type='reset' name='reset' value='Clear Form'> </th> </tr> </table> </FORM> </body> </html> Thankyou very much to everyone that may help So I can place the DDL inside the form, however it places it at the end of the form. I want it somewhere in the middle (immediately following first combo box) My other main issue is irregardless of the selection it simply posts the last option from the DDL not the one selected. Therefore I still want the second combo box to appear immediately below the first combo box and whatever option is selected from the second combo box I want to be posted with the rest of the form data. If you have any other ideas that would be great Obviously the reason I am still getting the same incorrect post is because the variable posted is still this1 from my code which reads the last value from the DDL. I have tried with all other variables to send as well ie ddl2 however still can't seem to send the selection. So in its current state how can I send the selection and place the second DDL within the form?? Thank you I am trying to pass data from one form to another form using the url i can get it to come up on the next pages url but how do i get it to go to a text box on the new form. is there a way of assigning text boxes. being trying it in javascript and asp even php would like to keep it to javascript but am open minded to just get it to work I have here a code that will automatically generate two text fields (Title & Price) when "Add another article" is pressed. I got this from the web, but I want instead of using a text field, I want it to create a drop down menu based on a mysql table, then update the price automatically (also based on the mysql table) on the other text field once a selection has been made on the drop down menu. Code: <link rel="stylesheet" type="text/css" media="screen" /> <style type="text/css"></style> <script type="text/javascript"> var elCount = 2; function add() { var parent = document.getElementById('parent'); var article = document.createElement('DIV'); article.id = 'article_' + elCount; article.name = 'article_' + elCount; // NEW LINE var article_title_label = document.createElement('LABEL'); article_title_label.appendChild(document.createTextNode('Title ' + elCount + ': ')); var article_title_text = document.createElement('INPUT'); article_title_text.id = 'article_' + elCount + '_title'; article_title_text.name = 'article_' + elCount + '_title'; // NEW LINE var article_textarea_label = document.createElement('LABEL'); article_textarea_label.appendChild(document.createTextNode('Price ' + elCount + ': ')); var article_textarea = document.createElement('INPUT'); article_textarea.id = 'article_' + elCount + '_price'; article_textarea.name = 'article_' + elCount + '_price'; // NEW LINE article.appendChild(article_title_label); article.appendChild(article_title_text); article.appendChild(article_textarea_label); article.appendChild(article_textarea); parent.appendChild(article); elCount++; } </script> <body> <div id="parent"> <div id="article_1"> <label for="article_1_title">Title 1: </label><input type="text" name="article_1_title" id="article_1_title" /> <label for="article_1_price">Price: </label><input type="text" name="article_1_price" id="article_1_price" /> </div> </div> any ideas? Thanks Hi all I'm a real newbie to Java script, I've literally been teaching myself for about 2 days now, but I've come across a bit of a problem which I'm sure is easy to fix so I was hoping for some pointers. Heres the problem: What I'm trying to do is create a document which allows you to select a size of box from a drop down menu, and then select a size of product to go into the box on a second drop down. The products on the second drop down menu will be allocated based on the box size that you've selected to make sure that you can only choose products which will fit in the box you've selected. In order to do this I've set up a 2D array, which lists each product and which boxes they will fit in using 0 for no and 1 for yes. When you select a box size from the drop down a value appears in a text box next to it (1, 2, 3, or 4) and what I need to do is use the number which appears in this text box to pull data from the array to populate the next drop down list. i.e. If option 2 appears from the first drop down selection then the second drop down should be populated with data from column 2 of array (In this example 1212, 1515, and 2020 would be shown in the second drop down) Im having trouble with the Java script to pull the values from the html text box in order to manipulate the array. If you look at the function 'top_biochill_addOption_list()' you will see that the second drop is populated here from row [itop2][3] of the array, which means the second drop down is permenantly populated as if option 3 had been selected from the first drop down. I need to get the value selected from the first drop down as a variable and replace the '3' in the above statement with that variable to get this to work but I have no idea how to go about that. Hopefully all will become clear when you see the code. As I say, I am very new to Javascript so I'm sure this code is probably messy and inefficient, but with that in mind I'd appreciate replies being in simplified terms so I can understand what you're getting at, or if anything gets re-written then a brief explaination of whats going on would be handy so I can understand what the code is actually doing! Thanks Code: <html> <head> <script type="text/javascript"> var linebreak = "<br />"; //Code to prints out the current product matrix function print_top_biochill_list(){ var topx=0 var topy=0 for (topi=0;topi<top_biochill.length;topi++) { document.write(top_biochill[topx][topy]+" "+top_biochill[topx][topy+1]+" "+top_biochill[topx][topy+2]+" "+top_biochill[topx][topy+3]+" "+top_biochill[topx][topy+4]+"<br />"); var topx=topx+1;}} //Code to create Drop Down Menu to select top Biochill function top_biochill_addOption(selectbox,text,value ){ var optn = document.createElement("OPTION"); optn.text = text; optn.value = value; selectbox.options.add(optn);} //Code to populate Top Biochill Drop Down Menu based on which size EPS is selected function top_biochill_addOption_list(selectbox){ var itop2=0 for (var itop=0; itop < top_biochill.length;++itop){ if (top_biochill[itop2][3]==1){ top_biochill_addOption(document.top_biochill_drop_list.top_biochill_list, top_biochill[itop][0], top_biochill[itop][0]); itop2=itop2+1 }}} function addtop_biochill(){ } </script> </head> <body onLoad="addtop_biochill();top_biochill_addOption_list()";> <script type="text/javascript"> //Creates an array to describe top biochill var top_biochill = new Array(); { //0=Name, 1=EPS10, 2=EPS15, 3=EPS30, 4=EPS45 top_biochill[0] = new Array(1212,1,1,1,1 ); top_biochill[1] = new Array(1515,1,1,1,1 ); top_biochill[2] = new Array(2020,0,1,1,1 ); top_biochill[3] = new Array(3015,0,0,1,1 ); top_biochill[4] = new Array(3020,0,0,0,1 ); top_biochill[5] = new Array(3040,0,0,0,1 ); } //Runs the prints the matrix code print_top_biochill_list(); </script> <!--Select EPS Size Drop Down Menu--> <form name="box_size" onsubmit="CheckForm()"> <select name="box_size_jump_menu" onchange="document.box_size.EPSshowvalue.value=this.value"> <option value=0>Please select a Box Size</option> <option value=1>EPS 10</option> <option value=2>EPS 15</option> <option value=3>EPS 30</option> <option value=4>EPS 45</option> </select> <input type="number" name="EPSshowvalue"> <script type="text/javascript"> top_biochill_addOption_list(); </script> </form> <!--Select Top Biochill Drop Down Menu--> <FORM name="top_biochill_drop_list" onsubmit="CheckForm()"> <SELECT NAME="top_biochill_list" onchange="document.top_biochill_drop_list.top_biochill_showvalue.value=this.value"> <Option value="" >Select Biochill</option> </SELECT> <input type="text" name="top_biochill_showvalue"><br> </form> </body> </html> Hello, I have this short script he Code: function resizeImages() { //Function will be ran onload in the <body> tag var img = document.images; //Puts all the images in an array for (var i = 0; i < img.length; i++) { //A loop to execute a set of functions for every image var parentElement = img[i].parentNode; //Gets parent element of image var parentWidth = parentElement.width(); //Gets width of parent element (value is an integer without "px") var imgWidth = img[i].width(); //Gets image width var parentHeight = parentElement.height(); //Gets height of parent element var imgHeight = img[i].height();//Gets image height if (parentWidth < imgWidth){ img[i].width(parentWidth); //Sets width of image to width of parent element img[i].style.height = "auto"; //Scales height } if (parentHeight > imgHeight){ img[i].height(parentHeight); //Sets height of image to height of parent element img[i].style.width = "auto"; //Scales width } alert(parentWidth); //To test if parentNode is working correctly. Should return an integer. } } It's got some JQuery in it (.width() and .height()) to make manipulation of the dimensions easier to manage. Basically, it's supposed to resize all the images on the webpage to the size of their parent elements (divs) without losing aspect ratio. Image overflow will be hidden so that no matter what the aspect ratio of the image and it's container the largest possible area of the image will be exposed. The alert() function I have at the bottom is supposed to run as a test that each loop is working correctly. However, my images don't get resized and I get no alert. I think the loop may be breaking out before it goes through everything. Anyone have ideas? I'm not a Javascript coder. Thank you, Jared Hello, I am very new to HTML and PHP but have managed to create a drop down "Surname" box on my website to list all the current surnames in my mySQL database. However, I also want the user to be able to type into the box and for the drop down list to automatically filter depending on the text the user inserts. I understand that this is not possible in HTML and PHP and requires some JavaScript, however I have never used this before and have no idea where to start. Any suggestions or help will be much appreciated. Here is my current HTML and PHP code... Code: $sql="SELECT Surname FROM Patients"; $result=mysql_query($sql); ?> <form name="form" method="POST" action="<?php echo $_SERVER['PHP_SELF'];?>"> Surname: <?php echo "<select name=\"surname\">"; echo "<option size =30 ></option>"; while($row = mysql_fetch_array($result)) { echo "<option value='".$row['Surname']."'>".$row['Surname']."</option>"; } echo "</select>"; ?> Thank you! Hi I am doing a java program. In which I have a jsp page, and on that I have two combobox. I have a create a java bean, in which I am extracting the database. I want to populate the combobox by extracting data from database. can anyone suggest me some code using java script , which i can use to populate my combobox. Thanks in advance I have 2 combo boxes where you can move the items in combo box 1 to combo box 2. I want to validate that combo box 2 actually has something moved to it. How can I count the items in combo box 2. Combo box 2 will initially have no items in the box on page load. It is up to the user to move the items to combo box 2 and I want to make sure at least 1 item was moved.
I was wondering if I could get some help in something. I am working on my church's website, and I previously implemented something called "Reftagger" onto the new website: http://www.logos.com/reftagger It "converts" any bible verse into a hyperlink as well as a tooltip. I thought that this was a neat idea, and wanted to do the same with the Westminster Larger (and Shorter) Catechism as well. Anytime it says "WLC Q58" (for example) I want it to automatically display that specific question and answer. So far, I simply have a basic tooltip and a hyperlink inserted for every WLC Q: http://covenantrpc.freehostia.com/covenant/sermons/ (just look at the page source and you'll see what I did). Then I have the tooltip.js file: http://covenantrpc.freehostia.com/co...ons/tooltip.js What I want to do is create some sort of definition library or glossary. One where it tells the webpage that every time the webpage says "WLC 58" it will be automatically converted into a hyperlink and tooltip, just like Reftagger. Hi all, I have a form which takes some values as input and stores them in a db for another use. I have the following java script to validate the entries. Code: <HTML><HEAD><TITLE>Electronic Deposting Form</TITLE> <script language="JavaScript"> <!-- script start function validateComplete(formObj) { if (emptyField(formObj.username)) alert("Please enter the Username."); else if (emptyField(formObj.passwd)) alert("Please enter the Password."); else if (emptyField(formObj.drop)) alert("Please enter the Drop Folder."); else return true; return false; } // Check to see if field is empty function emptyField(textObj) { if (textObj.value.length == 0) return true; for (var i=0; i<textObj.value.length; ++i) { var ch = textObj.value.charAt(i); if (ch != ' ' && ch != '\t') return false; } return true; } function chklen() { var un = document.getElementById("username").value var len = un.length; if (len > 15) { alert ("ERROR!!Only 15 characters are allowed in Username!!"); document.getElementById("username").value = un.substring(0,15); // remove excess characters } } // script end --> </script> Now I am planning to add a combo box to the form where I have the environment field. Following is the code for the form. Code: <td align="left" valign="top"><FORM name="form" action="../saveDP.cgi" method="post" onSubmit="return validateComplete(document.form)"><TABLE width="100%" cellPadding=2 cellSpacing=2> <TR> <TD width="26%" class="label"><B>Username </B></TD> <TD width="3%" class="label">:</TD> <TD width="71%"><INPUT maxLength=255 size=28 name=username id='username' onkeyup="chklen()"> <TR> <TD class="label" ><B>Password </B></TD> <TD class="label">:</TD> <TD><INPUT type=password maxLength=255 size=28 name=passwd> <TR> <TD class="label"><B> Environment </B></TD> <TD class="label">:</TD> <TD><SELECT class="input" size=1 name=environ> <OPTION value=us selected><b> US </b></OPTION> <OPTION value=uk><b> UK </b></OPTION> </SELECT> </TD> </TR> <TD colspan="3"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="19%"> </td> <td width="9%"><INPUT type=submit value=Submit v:shapes="_x0000_s1034"> </td> <td width="8%"><input type=reset value=Clear v:shapes="_x0000_s1035\"></td> <td width="64%"> </td> </tr> </table></TD> </TR> As I am new to JS, can anybody help me to implement a combo box( ie first two options are US and UK and third one is a text box which i can enter any value, can't be left blank while submitting the form) with "Environment" field? hi I wonder if someone out there can help me. I am very new to javascript and i have manged to understand a little of a double combo box with description however I would now like to be able to not only change the comment underneth but also add an image. This image (along with the comment) changes everytime the dropdownbox changes. I just cant seem to add the image. Please can anyone help I would really appreciate it and be extremely grateful. gr T Hello all, I have a form which contains some fields like company_name, address, phone, email etc. Also, I have a database with companies. I want that, when typing the beginning of the company name, a combo box to suggest all companies that match that text. I want that when a company is selected from the combo, all other textboxes to be filled with the correct info from the database. Also, I want that the user to be able to write a company that is not registered in the database. What I have done until now: For the editable combo I used the dhtmlxcombo from he http://dhtmlx.com/docs/products/dhtmlxCombo/ (Filtering mode: (filter existing list)). I'm not a scripting expert, so I think I cannot build this combo all by myself. I modified just one thing. At the begining, the dhtmlxcombo.js file contained something like this: Code: if (tab)z.tabIndex=tab;z.style.width = (width-19)+'px';self.DOMelem.appendChild(z);self.DOMelem_input = z;z = document.createElement('input');z.type = 'hidden';z.name = name;self.DOMelem.appendChild(z);self.DOMelem_hidden_input = z;z = document.createElement('input');z.type = 'hidden';z.name = (name||"").replace(/(\]?)$/, "_new_value$1");z.value="true";self.DOMelem.appendChild(z);self.DOMelem_hidden_input2 = z I added z.id='dest_company';, so the file looks something like this, now: Code: if (tab)z.tabIndex=tab;z.style.width = (width-19)+'px';self.DOMelem.appendChild(z);z.id='dest_company';self.DOMelem_input = z;z = document.createElement('input');z.type = 'hidden';z.name = name;self.DOMelem.appendChild(z);self.DOMelem_hidden_input = z;z = document.createElement('input');z.type = 'hidden';z.name = (name||"").replace(/(\]?)$/, "_new_value$1");z.value="true";self.DOMelem.appendChild(z);self.DOMelem_hidden_input2 = z};dhtmlXCombo_defaultOption.prototype._DrawHeaderButton = function(self, name, width) The text field 'dest_company' is generated like this: PHP Code: <select name="dest_company" id="dest_company" OnChange="SelectReceiver(document.comanda.dest_company.value);" style="width:206px;" tabindex="10"> <?php echo ' <option value=""></option>'; $address_result = mysql_query("SELECT * FROM `webdb_".$_COOKIE['user']."` ORDER BY companie ASC"); while($row = mysql_fetch_array($address_result)) { echo '<option value="'.$row['id'].'">'.$row["companie"].'</option>'; } echo ' </select> <script> var z = dhtmlXComboFromSelect("dest_company"); z.enableFilteringMode(true); </script>'; ?> This is the SelectReceiver() function: Code: function SelectReceiver(id_dest) { if (id_dest=="") { document.getElementById("contact_destinatar").value=""; document.getElementById("adresa_destinatar").value=""; document.getElementById("oras_destinatar").value=""; document.getElementById("judet_destinatar").value=""; document.getElementById("zip_destinatar").value=""; document.getElementById("telefon_destinatar").value=""; document.getElementById("mail_destinatar").value=""; return; } if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { //document.getElementById("detalii_destinatar").innerHTML=xmlhttp.responseText; var response = eval(xmlhttp.responseText); } } xmlhttp.open("GET","modifica_detalii_destinatar.php?q="+id_dest,true); xmlhttp.send(); } And the file modifica_detalii_destinatar.php looks like this: PHP Code: <?php $q=$_GET["q"]; include ('conectare.php'); $sql="SELECT * FROM `webdb_".$_COOKIE['user']."` WHERE id='".$q."'"; $result = mysql_query($sql); while($row = mysql_fetch_array($result)) { echo ' document.getElementById("contact_destinatar").value = "'.$row['contact'].'"; document.getElementById("adresa_destinatar").value = "'.$row['adresa'].'"; document.getElementById("oras_destinatar").value = "'.$row['oras'].'"; document.getElementById("judet_destinatar").value = "'.$row['judet'].'"; document.getElementById("zip_destinatar").value = "'.$row['zip'].'"; document.getElementById("telefon_destinatar").value = "'.$row['telefon'].'"; document.getElementById("mail_destinatar").value = "'.$row['mail'].'"; '; } ?> All this is working just in Firefox. In IE, when I select a company from the combo box, an error is generated and no text box is completed with the correct data. The error I'm talking about is: Code: 'document.comanda.compania_destinatar.value' is null or not an object In Firefox, if I inspect element with Firebug, my select looks like this: Code: <div style="width: 204px;" class="dhx_combo_box "> <input type="text" autocomplete="off" class="dhx_combo_input" tabindex="10" style="width: 185px;" id="companie_dest"> <input type="hidden" name="dest_company" value="45"> <input type="hidden" name="dest_company" value="false"> <img class="dhx_combo_img" src="codebase_xcombo/imgs/combo_select.gif"> </div> Any help on this would be great. Many thanks and best regards! i wud like to grab the values for the selected item in the last combobox n insert it into a form. thanks in advance Code: <!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="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <script type="text/javascript"> // first combo box data_1 = new Option("1", "$"); data_2 = new Option("2", "$$"); // second combo box data_1_1 = new Option("11", "-"); data_1_2 = new Option("12", "-"); data_2_1 = new Option("21", "--"); data_2_2 = new Option("22", "--"); data_2_3 = new Option("23", "--"); data_2_4 = new Option("24", "--"); data_2_5 = new Option("25", "--"); // third combo box data_1_1_1 = new Option("111", "1"); data_1_1_2 = new Option("112", "2"); data_1_1_3 = new Option("113", "3"); data_1_2_1 = new Option("121", "4"); data_1_2_2 = new Option("122", "5"); data_1_2_3 = new Option("123", "6"); data_1_2_4 = new Option("124", "7"); data_2_1_1 = new Option("211", "8"); data_2_1_2 = new Option("212", "9"); data_2_2_1 = new Option("221", "10"); data_2_2_2 = new Option("222", "11"); data_2_3_1 = new Option("231", "12"); data_2_3_2 = new Option("232", "13"); // other parameters displaywhenempty="" valuewhenempty=-1 displaywhennotempty="-select-" valuewhennotempty=0 function change(currentbox) { numb = currentbox.id.split("_"); currentbox = numb[1]; i=parseInt(currentbox)+1 // I empty all combo boxes following the current one while ((eval("typeof(document.getElementById(\"combo_"+i+"\"))!='undefined'")) && (document.getElementById("combo_"+i)!=null)) { son = document.getElementById("combo_"+i); // I empty all options except the first one (it isn't allowed) for (m=son.options.length-1;m>0;m--) son.options[m]=null; // I reset the first option son.options[0]=new Option(displaywhenempty,valuewhenempty) i=i+1 } // now I create the string with the "base" name ("stringa"), ie. "data_1_0" // to which I'll add _0,_1,_2,_3 etc to obtain the name of the combo box to fill stringa='data' i=0 while ((eval("typeof(document.getElementById(\"combo_"+i+"\"))!='undefined'")) && (document.getElementById("combo_"+i)!=null)) { eval("stringa=stringa+'_'+document.getElementById(\"combo_"+i+"\").selectedIndex") if (i==currentbox) break; i=i+1 } // filling the "son" combo (if exists) following=parseInt(currentbox)+1 if ((eval("typeof(document.getElementById(\"combo_"+following+"\"))!='undefined'")) && (document.getElementById("combo_"+following)!=null)) { son = document.getElementById("combo_"+following); stringa=stringa+"_" i=0 while ((eval("typeof("+stringa+i+")!='undefined'")) || (i==0)) { // if there are no options, I empty the first option of the "son" combo // otherwise I put "-select-" in it if ((i==0) && eval("typeof("+stringa+"0)=='undefined'")) if (eval("typeof("+stringa+"1)=='undefined'")) eval("son.options[0]=new Option(displaywhenempty,valuewhenempty)") else eval("son.options[0]=new Option(displaywhennotempty,valuewhennotempty)") else eval("son.options["+i+"]=new Option("+stringa+i+".text,"+stringa+i+".value)") i=i+1 } //son.focus() i=1 combostatus='' cstatus=stringa.split("_") while (cstatus[i]!=null) { combostatus=combostatus+cstatus[i] i=i+1 } return combostatus; } } //--> </script> </head> <body> <form> <select name="combo0" id="combo_0" onChange="change(this);" style="width:200px;"> <option value="value1">-select-</option> <option value="value2">1</option> <option value="value3">2</option> </select> <BR><BR> <select name="combo1" id="combo_1" onChange="change(this)" style="width:200px;"> <option value="value1"> </option> </select> <BR><BR> <select name="combo2" id="combo_2" onChange="change(this);" style="width:200px;"> <option value="value1"> </option> </select> <BR><BR> </form> </body> </html> Hi, i have a form that uses POST but the post url also has some parameters with it. But i want the parameters to changing depending on a few combo boxes on the page. So what i want to happen is when the combo box is changed it sets a variable and that variable is some how used in the URL link within the HTML. Ive tried writing a function that gets the text of the combo as it changes by alert me with a popup. But when i try to use document.write to add my var in HTML it simple wont show. Am i doing this all wrong? Thanks andy |