Quote:
Originally Posted by Rickkap
Hello
The newuserid is located here:
Code:
><label for="newuserid">
This is in the form.
|
Either I'm making another ASP mistake or else you didn't read my question very carefully! At this point, I'm honestly not sure which it is.
Where is the
input element with ID of "newuserid" located? What you have there is a label element with a "for" attribute pointing to a non-existent input element. Even if the label had an ID of "newuserid" requesting its value would get you a javascript error since it doesn't have a value property to call upon.
Then your javascript goes on to reference the value of the element retrieved by the ID "newuserid" - which is an empty set, really. No element in the page has that ID. So unless this is another coding oddity of ASP I think you will need to pay attention to this one.
Quote:
Originally Posted by Rickkap
...In ASP the IF statement is there to check and not assign a variable...
|
Crap! Can't argue with that one. Like I said, I have nil in the way of ASP experience. Good to know, though.
Quote:
Originally Posted by Rickkap
...The code:
Code:
strCmd = trim(Request.Form("strCmd").Item)
Session("strQuestion") = trim(Request.Form("strQuestion").Item)
Has been removed from the ASP file but really all this does is remove white spaces at the begining and end of the string...
|
Again, possibly showing my ASP ignorance, but if you remove BOTH of those two lines of code how do you have anything at all in the
Session("strQuestion") variable you are working with later in the script? It looks to me like you just need to remove the ".Item" part from each of those two lines (I guess you can still delete the first of those two lines, though, since you never use the strCmd variable anywhere).
As for the trim functionality, I figured as much (given the "trim" function) but the format looked wrong
for the variable being passed to the trim function. For all I know, using ".Item" may split the string and trim each piece before reassembling. I wouldn't know with ASP - it could do any number of different things. But in any case it doesn't match sample form handling code I have seen so far in my life.
My deeper confusion about your problem is that, from what I can see, regardless of your input you should be receiving only one of two possible responses (either "Error This Record Exists." or "Checked!!!!") if your ASP code is actually working. Yet you are reporting an entirely separate response.
This would seem to indicate that either 1) you are not ever getting submitted to your ASP page and something else is putting a response into your target div, or 2) you have another problem somewhere within your ASP script that is causing it to vomit your output back to you rather than test it correctly in the "if/else" statements and return what it ought to return. Even if the whitespace was not removed it would still be a problem to receive your own statement back since it is not one of the two things that is supposed to be sent back.
If it was *just* a problem of your javascript sending the wrong variable value you would still be seeing either the "error" message or the "checked" message, wouldn't you? Or is ASP
completely in bizarro world?