473,800 Members | 2,483 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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="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
Jul 23 '05 #1
1 1391
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>
Jul 23 '05 #2

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

Similar topics

17
25421
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
1987
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 exception saying that ViewState was invalid. I suspect it has something to do with cache expiration time. Can I control its expiration time from within my web.config? Or anyhow? Couldn't find anything related in web or machine config files or...
6
1178
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 Value As Boolean) Form1.CheckBox1.Checked = Value End Set
3
1491
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 (txtHeader1, txtHeader2) that I want to use to change the header labels in the report (lblHeader1, lblHeader2). When the user clicks the print button, this code runs: Select Case Me!fraWhere Case 1 DoCmd.OpenReport...
0
9555
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10514
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10287
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10260
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9099
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5479
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5616
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4156
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2956
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.