Java Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesJava Help

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:
  #1  
Old March 18th, 2003, 02:57 PM
snakebite003 snakebite003 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2002
Posts: 19 snakebite003 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy Dynamic textbox validation

i am having trouble validating a piece of code that i cannot find out how to do...what i have is a form that is done in asp that loads info from the database...i have textfields that are dynamic and are an option to the user if they want to add comments...

the user would click on the radio button indicating that they will use the textfield and then they would enter in there comments...the problem is, i am trying to create validation for this piece of code which is written in ASP...i don't want the user, when they click on the radio button to use the textfield, to submit an empty field into the database or submit illegal characters and numbers...this textfield should only be allowed to pass letters...how do i do this in javascript when the textfield has a dynamic name???? how do i call an ASP variable into javascript to do validation???any suggestions are welcomed???
here is snippet of the code that contains the text field i want to validate from the ASP page...

the part that i want to add validation is <input type=text name=wi" & currentposition & " size=50 value='Write-In'>, which you will see in the code below...

Case "ED"
If office_positions("Position")= Session("COLLEGE") AND Session("LEVEL")<>"GR" AND Session("LEVEL")<>"DR" Then
If checkbox = "y" Then
response.write "&nbsp;&nbsp;&nbsp;&nbsp;<input type=checkbox name=senator1 value=writein1>&nbsp;&nbsp;<input type=text name=wisenator1 size=50 value='Write-In'><br>"
response.write "&nbsp;&nbsp;&nbsp;&nbsp;<input type=checkbox name=senator2 value=writein2>&nbsp;&nbsp;<input type=text name=wisenator2 size=50 value='Write-In'><p>"
checkbox = "n"
Else
response.write "&nbsp;&nbsp;&nbsp;&nbsp;<input type=radio name=" & currentposition & " value=writein>&nbsp;&nbsp;<input type=text name=wi" & currentposition & " size=50 value='Write-In'><p>"
End If
response.write "<hr><b>&nbsp;&nbsp;Senator Collegiate - " & office_positions("Title") & "</b><hr>"
if canidates("Canidate")="No Canidate" then
response.write "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;No Canidates are running for this position<br>"
else
response.write "&nbsp;&nbsp;&nbsp;&nbsp;<input type=radio name=" & office_positions("Position") & " value=" & canidates("Canidate_id") & ">&nbsp;&nbsp;"
response.write canidates("Canidate") & "&nbsp;&nbsp;(" & canidates ("Party") & ")<br>"
end if
skip_records="N"
lastposition = office_positions("Position")
Else
skip_records="Y"
End If

Reply With Quote
  #2  
Old March 18th, 2003, 03:11 PM
Nemi Nemi is offline
Clueless llama
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Feb 2001
Location: Lincoln, NE. USA
Posts: 2,353 Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 2 Days 12 h 35 m 19 sec
Reputation Power: 111
You have the wrong forum. You want either the ASP or Javascript/html forum. This is for Java.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesJava Help > Dynamic textbox validation


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


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





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT