On Fri, 14 May 2004 23:09:34 +0200, "[Miren]"
<bo**********@e xcite.com> wrote:
Hello i have one great problem with one form.
i must to know, for submmiting the form, if the user, has change the
select, has select one or no.
in my select i have:
<select name="maquina" >
<option selected="selec ted" value="0">Elige una opcion</option>
<option value="4">asdfa sdf</option>
<option value="5">asdfa sdfasdf</option>
</select>
if the selectd value is 0 the user has not select, if isn't 0 the user has
selected one option, in this case the form is submmited.
how can i controle this problemm using javascript?
do you have one sample?
can you help me?
thnaks
here is a sample of some code i have been working on for a project.
Hope it helps you out some. I'm not sure it's the most efficent method
but it works. I have the JavaScript portion as a part of a validation
function that run OnSubmit.
Let me know if you have any more problems
Josh Austin
System Admin
Agent Services of America
ks*****@comcast .net
<script language="JavaS cript" type="text/javascript">
<!--
//JavaScript section (modify this using your form name in place of
//theForm and your field name in place of Dproduct
//Place an error message to be displayed to the user in place
//of Please select a product.......
function Form1_Validator (theForm)
{
// Check if no drop down or the default drop down was selected
if (theForm.Dprodu ct.selectedInde x <= 0)
{
alert("Please select a product type from the drop down list.");
theForm.Dproduc t.focus();
return (false);
}
-->
<!--Html Section-->
<!--I put the html section here for your reference-->
<SELECT size="1" name="Dproduct" >
<option value="0" selected>
Please Select One...
<option value="10">
10 Year Term
<option value="15">
15 Year Term
<option value="20">
20 Year Term
<option value="25">
25 Year Term
<option value="30">
30 Year Term
<option value="SV">
Survivorship
<option value="UP">
Universal Life w/LPT
<option value="UL">Univ ersal Life</option>