|
how can i make it so spaces in my textboxfeild Doesnt Throw an error whenver i put spaces in the words..??? im getting an type mismatch error whenever i submit.. if i leave out all the spaces it works fine
THANKS
|
|
|
Since you posted to the ASP forum, I will assume you are processing the textbox value in VBScript. Can you post the part of your code where you 1) read in the value from the Request.Form, and 2) where you are getting the error. (This may be the same line of code.) Without seeing your code, whenever I hear of something that works without spaces, but fails with spaces, it`s usually a problem with the quotes. In most places, to properly handle spaces, your code must wrap the value in double quotes.
|
|
|
|
|
DOH! No, you posted this in the Javascript forum. My bad. This is again most likely a quotes issue. Please post the applicable sections of code for review. I think you can also get a type mismatch error if you try to do something like this:
var myString = "Hello, " + document.forms[0].FirstName;
Do you see the error? The line above should have been:
var myString = "Hello, " + document.forms[0].FirstName.value;
I make this mistake all the time--I forget to add the ".value" in my javascript. Without the ".value", you are referencing the entire element object rather than the string.
|
|
|
|
|
|
|
|
|
|