Wrox Programmer Forums
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
Join Date: Jan 2005
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

<select name="chddate<%=j%>"
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>"
        Response.write "<option value=" & d & ">" & d & "</option>"
    end if
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?



Ayrshire Minis - a Mini E-Community
Old July 7th, 2005, 04:34 PM
Friend of Wrox
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post

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.

- 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.