Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


VB Script form using .asp

 
Logged in as: Guest
arrSession:exec spGetSession 2,3,1108
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> ASP >> VB Script form using .asp
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 VB Script form using .asp - 7/2/2004 8:07:34 AM   
  lankfordc

 

Posts: 1
Score: 0
Joined: 7/2/2004
From: USA
Status: offline
Hi I am working on a form. The form has a field that needs to be required if the uses selects the option "Yes" from the a drop down menu. I used an If Then statement and it doesn't work. The form acts asif there is not function tied to the "Yes" option. Do anyone have any suggestions?

Here's what I'm talking about:


*****If Then Statement*****


If Request.Form("product_sold_option") = "Yes" Then
If Request.Form("product_sold") = "" Then
errs = addError("product_sold", "(Product sold is required)")
End IF
End If

If Request.Form("product_sold_option") = "Yes" Then
If Request.Form("acct_number") = "" Then
errs = addError("acct_number", "(Account number is required)")
End IF
End If





*********Body*********

<table>
<tr><td valign="top"><span style="color:#FF0000;">*</span>
Was there a Product/Service Sold?</td>

<b><td width="100%">
<select name="product_sold_option" id="product_sold_option"<%=BadFields("product_sold_option")%>>
<option value="">-Select One-</option>
<option value="yes">Yes</option>
<option value="no">No</option>
<option value="pending">Pending</option>
</select><%=BadText("product_sold_option")%></td></b>
</table>
 
 
Post #: 1
 
 Re: VB Script form using .asp - 8/17/2004 10:04:05 PM   
  Matt

 

Posts: 30
Score: 0
Joined: 8/17/2004
From: United Kingdom
Status: offline
If Request.Form("product_sold") = " " what then?
If IsNull(Request.Form("product_sold")) then what?

I recomend
If trim(Request.Form("product_sold")) = "" or IsNull(Request.Form("product_sold"))
in place of your second line.

(in reply to lankfordc)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> ASP >> VB Script form using .asp Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts