|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 " <input type=checkbox name=senator1 value=writein1> <input type=text name=wisenator1 size=50 value='Write-In'><br>" response.write " <input type=checkbox name=senator2 value=writein2> <input type=text name=wisenator2 size=50 value='Write-In'><p>" checkbox = "n" Else response.write " <input type=radio name=" & currentposition & " value=writein> <input type=text name=wi" & currentposition & " size=50 value='Write-In'><p>" End If response.write "<hr><b> Senator Collegiate - " & office_positions("Title") & "</b><hr>" if canidates("Canidate")="No Canidate" then response.write " No Canidates are running for this position<br>" else response.write " <input type=radio name=" & office_positions("Position") & " value=" & canidates("Canidate_id") & "> " response.write canidates("Canidate") & " (" & canidates ("Party") & ")<br>" end if skip_records="N" lastposition = office_positions("Position") Else skip_records="Y" End If |
|
#2
|
|||
|
|||
|
You have the wrong forum. You want either the ASP or Javascript/html forum. This is for Java.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Java Help > Dynamic textbox validation |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|