Hello,
I'm still struggling with my website, more specifically with the PHP script. I'm now trying to get the PHP script to read a value from a drop down box. There are 2 drop down boxes, where the value of the first determines the vales in the second one (it is to select hour and minutes). This part works.
I currently have this in the header of the HTML file:
This is in the form definition:
And this is in the PHP script:
There are values in the PHP variables, for the hours it is 1 or 2 (1 for 9,10,11,14,15,16,17; 2 for 12,18); for the minutes it is the index of the item in the list.
How can I get the value that is selected in the dropdownbox in my PHP script (for both the hours and the minutes)?
Thanks!
Jörg
I'm still struggling with my website, more specifically with the PHP script. I'm now trying to get the PHP script to read a value from a drop down box. There are 2 drop down boxes, where the value of the first determines the vales in the second one (it is to select hour and minutes). This part works.
I currently have this in the header of the HTML file:
Code:
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript"> // Initialize class for Type and Style function Uur(id, uur){ this.id = id; this.uur = uur; } function Min(id, id_uur, min){ this.id = id; this.id_uur = id_uur; this.min = min; } // uren definieren UurArray = new Array( new Uur(1, "9"), new Uur(1, "10"), new Uur(1, "11"), new Uur(2, "12"), new Uur(1, "14"), new Uur(1, "15"), new Uur(1, "16"), new Uur(1, "17"), new Uur(2, "18")); // minuten definieren MinArray = new Array( new Min(0, 1, "00"), new Min(1, 1, "05"), new Min(2, 1, "10"), new Min(3, 1, "15"), new Min(4, 1, "20"), new Min(5, 1, "25"), new Min(6, 1, "30"), new Min(7, 1, "35"), new Min(8, 1, "40"), new Min(9, 1, "45"), new Min(10, 1, "50"), new Min(11, 1, "55"), new Min(0, 2, "00"), new Min(1, 2, "05"), new Min(2, 2, "10"), new Min(3, 2, "15"), new Min(4, 2, "20"), new Min(5, 2, "25")); function time_init(sel_uur, sel_min){ document.form1.id_uur.options[0]= new Option("uur"); document.form1.id_min.options[0]= new Option("min"); for(i = 1; i <= UurArray.length; i++){ document.form1.id_uur.options[i] = new Option(UurArray[i-1].uur, UurArray[i-1].id); if(UurArray[i-1].id == sel_uur) document.form1.id_uur.options[i].selected = true; } ChangeMin(sel_min); } function ChangeMin(sel_min){ sel_uur_index = document.form1.id_uur.selectedIndex; sel_uur_value = parseInt(document.form1.id_uur[sel_uur_index].value); for(i = document.form1.id_min.length - 1; i > 0; i--) document.form1.id_min.options[i]= null; j=1; for(i = 1; i <= MinArray.length; i++){ if(MinArray[i-1].id_uur == sel_uur_value){ document.form1.id_min.options[j]= new Option(MinArray[i-1].min, MinArray[i-1].id); if(MinArray[i-1].id == sel_min) document.form1.id_min.options[j].selected = true; j++; } } }
Code:
<select name="id_uur" id="id_uur" size="1" style="" onChange="ChangeMin()" onblur="return CheckUur()"></select> <select name="id_min" id="id_min" size="1" style="" onblur="return CheckUur()"></select>
Code:
$id_uur = $_REQUEST['id_uur'] ; $id_min = $_REQUEST['id_min'] ;
How can I get the value that is selected in the dropdownbox in my PHP script (for both the hours and the minutes)?
Thanks!
Jörg
Comment