alexarpad2003 Posted July 18, 2011 Report Posted July 18, 2011 Am un select :<select name="selector"><OPTION value="" selected>Tip</OPTION><OPTION value="1" selected>masina</OPTION><OPTION value="1" >televizor</OPTION><OPTION value="1" >telefon</OPTION><OPTION value="9" >portofel</OPTION></select>Problema e ca nu pot modifica value la nici o optiune.Cum as putea returna pe alta pagina cu POST ceea ce selecteaza userul ? Nu vreau valorile de la value, vreau sa-mi returneze masina, televizor etc.Am nevoie de o idee. Quote
razer_krait Posted July 18, 2011 Report Posted July 18, 2011 (edited) Se poate face cu javascript.Parca innerhtml.Vin imediat cu rezolvarea.Gata am gasit, uite aici link catre exemplu de la w3schools.Si uite aici codul care iti returneaza intr-un window nou ce ai ales:<html><head><script type="text/javascript">function displayResult(){var x=document.getElementById("mySelect").selectedIndex;var y=document.getElementById("mySelect").options;var a=window.open();a.document.write("Your choice was " + y[x].text);}</script></head><body><form>Select your favorite fruit:<select name="selector" id="mySelect" onChange="displayResult();"><OPTION value="" selected>Tip</OPTION><OPTION value="1" selected>masina</OPTION><OPTION value="1" >televizor</OPTION><OPTION value="1" >telefon</OPTION><OPTION value="9" >portofel</OPTION></select></form></body></html> Edited July 18, 2011 by razer_krait 1 Quote
anon Posted July 18, 2011 Report Posted July 18, 2011 HTML <SELECT> and PHP PHP Server Side Scripting forum at WebmasterWorld HTML - PHP Form ExampleStudiaza putin acolo . Quote
alexarpad2003 Posted July 18, 2011 Author Report Posted July 18, 2011 anon chestile alea le stiu.razer_krait merci de pont, o sa caut functile post pentru javascript. Merci+rep razer_krait Quote