|
In my .asp code I have several different recordsets. If there is data in a RS it then drops down and evaluates that code. Within there, I've got a hidden text element. If my RS is empty, it skips all the code, including that hidden field. So when I then validate the form upon Submit it doesn't know about that hidden field and NONE of my javascript works.
Example:
<% if not rs2.eof then %>
<input type="hidden" name="EYtype" value="<%= rs2("ProgramType") %>">
......
<% if not rs3.eof then %>
<input type="hidden" name="EDtype" value="<%= rs3("ProgramType") %>">
So let's say I've got some data in rs2...but none in rs3 then this doesn't work:
alert(myForm.EDtype.value);
It doesn't alert anything...just skips my entire javascript file altogether. You would think that if it couldn't evaluate that, it would at least drop down and continue with the rest of my javascript, but it doesn't. It just exits out. How can I get my form to work, even if there is not data in a recordset? If this doesn't make sense, I'd be happy to elaborate.
|
|
|
I figured this out! (that is the way it always works, can't figure it out until I post it publicly!). Anyhow, I just check to see if the field exists and that seems to work!
|
|
|
|
|
|
|
|