ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old August 14th, 2003, 12:40 PM
Rhaslani Rhaslani is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 10 Rhaslani User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
ASP or HTML? to verify selection

I have a webpage where there are two drop down menues. From each of them, one item can be selected. I need code to test if there was an item selected from both the drop down menus. How do I do this? Do use ASP or HTML? Any help would be great. Thanks.

Reply With Quote
  #2  
Old August 14th, 2003, 12:43 PM
unatratnag unatratnag is offline
Average Intelligence
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2003
Location: Ohio/Chicago
Posts: 678 unatratnag User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 22 sec
Reputation Power: 6
Send a message via AIM to unatratnag
if you're doing a validation of checking to make sure that they are selected you'll need to use javascript.

ASP is server side so if you submit to whatever form, when you submit you can make sure that d1.value<>"" and make sure d2.value<>""

Reply With Quote
  #3  
Old August 14th, 2003, 01:03 PM
Rhaslani Rhaslani is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 10 Rhaslani User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
what code do I need exactly to use the d2.value<>"" command? I mean what exactly do i need to enter?

Reply With Quote
  #4  
Old August 14th, 2003, 01:07 PM
unatratnag unatratnag is offline
Average Intelligence
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2003
Location: Ohio/Chicago
Posts: 678 unatratnag User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 22 sec
Reputation Power: 6
Send a message via AIM to unatratnag
I don't know, you're the one doing the validating, i'd need to know the set up or what you'd want to do, maybe redirect back to the form if they didn't enter it correctly with querystring response?

<%
if (d1.value="" or d2.value="") then
response.redirect "form.asp?validate=no
end if
%>

then in your original form if querystring validate=no then display a div stating that you didn't enter correctly.... the common practice is javascript though really.

Reply With Quote
  #5  
Old August 14th, 2003, 01:11 PM
Rhaslani Rhaslani is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 10 Rhaslani User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks for that. This is what I am working with. This is the drop down menu on the first page:

<form method="POST" action="results1.asp">
<p>Select a Variable:</p>
<p><select size="1" name="Variable">
<option>Amount of Dollars</option>
<option>Amount of Hours</option>
<option>Number of Tickets</option>
</select></p>

</form>

Then on the second page:
I have this to make it appear:

<%

Dim sOutput

sOutput = Request.Form("variable")
Response.Write(sOutput)

%>


I need to make sure one of the values is selected from that drop down menu.

Reply With Quote
  #6  
Old August 14th, 2003, 09:14 PM
unatratnag unatratnag is offline
Average Intelligence
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2003
Location: Ohio/Chicago
Posts: 678 unatratnag User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 22 sec
Reputation Power: 6
Send a message via AIM to unatratnag
Do something with javascript in this case....

Code:
<form onSubmit="return validate()">


<script>
function validate() 
{ 
submitOK="True"; 
var message = "Form incomplete:\n"; 

if (document.Variable.value.length<1) 
{ message += "Drop Down Menu.\n"; 
submitOK="False"; } 

if (submitOK=="False") 
{ 
alert(message) 
return false; 
} 
else 
{ 
return true; 
} 

</script>

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > ASP or HTML? to verify selection


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway