Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 7th, 2005, 08:12 AM
Friend of Wrox
Points: 8,019, Level: 38
Points: 8,019, Level: 38 Points: 8,019, Level: 38 Points: 8,019, Level: 38
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2005
Location: Mauchline, East Ayrshire, Scotland
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default select generated automatically with asp

Code:
<select name="chddate<%=j%>"
onChange="document.form.chdbirthday<%=j%>.value=document.form.chddate<%=j%>.options[document.form.chddate<%=j%>.selectedIndex].value+document.form.chdmonth<%=j%>.options[document.form.chdmonth<%=j%>.selectedIndex].value+document.form.chdyear<%=j%>.options[document.form.chdyear<%=j%>.selectedIndex].value;"
style="color: black; font: 7pt Verdana, Arial, Helvetica, sans-serif;"> 



<%
        Response.write "<option> --- </option>"
For d = 1 to 31
    if len(d) = 1 then
        Response.Write "<option value=0"& d & ">" & d & "</option>"
    else
        Response.write "<option value=" & d & ">" & d & "</option>"
    end if
Next
%> 
</select>
I have the dynamically-generated drop down, done with ASP.

Has anyone got JavaScript that when the value '---' is selected a alert box will appear to prevent it being submitted with that value?

TIA.

Picco

www.crmpicco.co.uk
www.crmpicco.co.uk.tt
www.milklemonadechocolate.uk.tt
www.griswolds.uk.tt
www.piccosmini.co.uk.tt
www.morton.uk.tt
__________________
_______________________
Ayrshire Minis - a Mini E-Community
http://www.ayrshireminis.com
http://www.crmpicco.co.uk
 
Old July 7th, 2005, 04:34 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Set the value attribute for the <option> tag of "---" too and onsubmit using javascript check if it is equal to "---", and use alert() to popup the error.

Hope that helps.
Cheers

_________________________
- Vijay G
Strive for Perfection




Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP.NET Generated XHTML Mr Fett BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 5 February 7th, 2007 01:33 AM
Automatically select value from a calculated field jimmy0305 Access 0 June 21st, 2005 10:43 AM
ASP and auto-generated primary keys Steve777 Classic ASP Professional 2 May 26th, 2005 10:47 AM
automatically generated textboxes noor ASP.NET 1.0 and 1.1 Basics 6 May 11th, 2005 09:28 AM
Automatically select no for dialog box Arsi C# 0 December 10th, 2004 03:46 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.