473,385 Members | 2,269 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

controling if the user has slected one option or no

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="selected" value="0">Elige una opcion</option>
<option value="4">asdfasdf</option>
<option value="5">asdfasdfasdf</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
Jul 23 '05 #1
1 1363
On Fri, 14 May 2004 23:09:34 +0200, "[Miren]"
<bo**********@excite.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="selected" value="0">Elige una opcion</option>
<option value="4">asdfasdf</option>
<option value="5">asdfasdfasdf</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="JavaScript" 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.Dproduct.selectedIndex <= 0)
{
alert("Please select a product type from the drop down list.");
theForm.Dproduct.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">Universal Life</option>
Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: Lauren Wilson | last post by:
Hi folks, Can someone point me to some resources on how to control FTP sessions from and Access application with VBA? Many thanks for all help. --LW.
2
by: Kikoz | last post by:
Hi all. I keep my ViewState in server's cache. Works fine except when user leaves the page opened for a long time (2 hours or so). Then if he/she tries to post it back the server throws an...
6
by: Matthew | last post by:
I am wondering if it is possible to make something like the following work: Public Class myTestSettings Public Property onTop() As Boolean Get Return Form1.CheckBox1.Checked End Get Set(ByVal...
3
by: fauxanadu | last post by:
I have a report called rptFilter. In my frmPrint Form, I have four option controls that allow for selection of specific criteria to contol what appears in the report. I also have two text boxes...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.