cote_apc Posted May 6, 2013 Report Share Posted May 6, 2013 Hola chicos, estoy usando CFORMS II (http://www.deliciousdays.com/cforms-plugin/ ) para el envío de una ficha y necesito ayuda para incluir un combobox dentro del formulario. No entiendo mucho del código, pero el comobox base que estoy usando es el que dejo a continuación. Quisiera saber si alguien me puede ayudar con esto, he buscado mucho en el foro del plugin en cuestión y no logro encontrar algo que me sirva, por eso busqué esta forma del desplegable. El formulario en cuestión funciona con campos comunes para llenar, la variación es que en un campo si se selecciona una comuna, debe salir opciones específicas relacionadas a la comuna elegida y por otra parte al final de los campos existe otro combobox (como el que dejo abajo) que tiene 3 campos de variables. Por otra parte estos datos deben llegar en el correo al igual que los otros y además se debe incluir en el archivo que se puede descargar de la opción que da el plugin, de seguimiento de datos, archivo csv. De antemano muchas gracias,Saludos! <form name="myform"><div align="center"> <select name="optone" size="1" onchange="setOptions(document.myform.optone.options[document.myform.optone.selectedIndex].value,document.myform.opttwo);"> <option value=" " selected="selected"></option> <option value="1">First Choice</option><option value="2">Second Choice</option><option value="3">Third Choice</option> </select><select name="opttwo" size="1" onchange="setOptions(document.myform.opttwo.options[document.myform.opttwo.selectedIndex].value,document.myform.optthree);"> <option value=" " selected="selected">Please select one of the options above first</option> </select><select name="optthree" size="1"> <option value=" " selected="selected">Please select one of the options above first</option> </select><input type="button" name="go" value="Value Selected" onclick="alert(document.myform.optthree.options[document.myform.optthree.selectedIndex].value);" /></div></form><script type="text/javascript">function setOptions(chosen, selbox) {selbox.options.length = 0;if (chosen == " ") { selbox.options[selbox.options.length] = new Option('Please select one of the options above first',' ');setTimeout(setOptions(' ',document.myform.optthree),5);}if (chosen == "1") { selbox.options[selbox.options.length] = new Option('first choice - option one','11'); selbox.options[selbox.options.length] = new Option('first choice - option two','12');setTimeout(setOptions('11',document.myform.optthree),5);}if (chosen == "2") { selbox.options[selbox.options.length] = new Option('second choice - option one','21'); selbox.options[selbox.options.length] = new Option('second choice - option two','22');setTimeout(setOptions('21',document.myform.optthree),5);}if (chosen == "3") { selbox.options[selbox.options.length] = new Option('third choice - option one','31'); selbox.options[selbox.options.length] = new Option('third choice - option two','32');setTimeout(setOptions('31',document.myform.optthree),5);}if (chosen == "11") { selbox.options[selbox.options.length] = new Option('first choice - option one - sub one','111'); selbox.options[selbox.options.length] = new Option('first choice - option one - sub two','112');}if (chosen == "12") { selbox.options[selbox.options.length] = new Option('first choice - option two - sub one','121'); selbox.options[selbox.options.length] = new Option('first choice - option two - sub two','122');}if (chosen == "21") { selbox.options[selbox.options.length] = new Option('second choice - option one - sub one','211'); selbox.options[selbox.options.length] = new Option('second choice - option one - sub two','212');}if (chosen == "22") { selbox.options[selbox.options.length] = new Option('second choice - option two - sub one','221'); selbox.options[selbox.options.length] = new Option('second choice - option two - sub two','222');}if (chosen == "31") { selbox.options[selbox.options.length] = new Option('third choice - option one - sub one','311'); selbox.options[selbox.options.length] = new Option('third choice - option one - sub two','312');}if (chosen == "32") { selbox.options[selbox.options.length] = new Option('third choice - option two - sub one','321'); selbox.options[selbox.options.length] = new Option('third choice - option two - sub two','322');}}</script> Link to comment Share on other sites More sharing options...
roberto1982 Posted May 9, 2013 Report Share Posted May 9, 2013 Aunque mire rapido el codigo, no veo para donde va ese formulario, no lo envias post? no tiene una direccion donde llegar, si lo envias solamente asi quedara en esa pagina.L Lo otro ese js hace algo mas? me refiero tal vez pasas por ahi los datos (ajax). Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now