Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

validating a textbox based on the value of a chkbox

Status
Not open for further replies.

jamica

Programmer
Apr 25, 2005
17
GB
hi can anyone help me imreally stuck dont no what im doing wrong .... what im trying to do is server side vaildation in vbscript to see if a chkbox is chked then the textbox cannot be empty... i also need to maintain the values in the fields if onsubmit there are otehr errors on the page

i have this code:
<% If Request.Form("POSTED") AND Request.Form("other_lang_chk") = "true" Then
Response.Write "<input name='other_org' type='checkbox' id='other_org' value='true' checked >"
else
Response.write "<input name='other_org' type='checkbox' id='other_org' value='true'>"
End If %>

please help im really stuck .......... your help will be much apprieciated
 
im getting the error msg that i created ......

errorMessage = errorMessage & "<p class=red><strong>You must enter details of your other language</strong></p>"

 
Show us the full page worth of code.

All of the low hanging fruit of easy guesses have been guessed. At this point we gotta roll up the sleeves and get dirty.
 
i hope that this lis not as it looks

Code:
 <input type="hidden" name="POSTED" value="true">

and all other dims here
Dim lang_error

If other_lang_chk = "Yes" AND other_lang = "" then
        lang_error = "true"                
        errorMessage = errorMessage & "<p class=red><strong> </strong></p>"
        else
        errorMessage = errorMessage & "<p class=red><strong>You must enter details of your other language</strong></p>"
        
        End If


<td width="8%">

you are missing delimiters <% %>
 
i have the delimiters around the whole validation
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top