"Raymond D'Anjou"
Quote:
> I have (or not) this input field in my ASP page:
> <INPUT type="text" size=10 maxlength=10 id=txtTransAmount
> name=txtTransAmount>
> If it doesn't exist and I try to validate it the page fails.
> How can I check for the existence if this field in javascript before
> validating it?
if I understand the problem correctly you are trying to use server-side
JavaScript to validate the input field through asp
so your code probably looks something like this ...
<%
...
if(Request.Form("txtTransAmount") == "test") return;
%>
to test for the existence of a form field in asp-jscript do something like
this ...
<%
...
if(Request.Form("txtTransAmount").Count == 0)
{
// no input elements by that name exist
return;
}
else
{
// use Request.Form("txtTransAmount")
}
%>