codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  Type Mismatch error  Archive Import (CodeMage) at 17:52 on Thursday, July 17, 2003
 

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




  Re: Type Mismatch error  Troy Wolf at 16:24 on Sunday, July 20, 2003
 

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.
Troy Wolf: site expert
Shiny Solutions


  Re: Type Mismatch error  Troy Wolf at 16:28 on Sunday, July 20, 2003
 

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.
Troy Wolf: site expert
Shiny Solutions









CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  Re: onload event
•  Active Widgets
•  Re: onmouseover change image and text
•  Line Printer Interface
•  import contacts of msn/yahoo
•  Call windows apps from web apps
•  Re: ASP.NET web controls
•  netscape 6 browser problem
•  Re: Print .doc file from the website using System.Diagnostics.Process


Recent Articles
Communicating with the Database (Using ADO)
MagicGrid
Simple Thumbnail Browsing Solution
Type Anywhere
A Better Moustrap: FmtDate to replace FormatDateTime
ASP.NET Forum Source Code
Internal Search Engine
Javascript Growing Window
Simple date validation
Search engine friendly URLs using ASP.NET (C#.NET)


Site Survey
Help us serve you better. Take a five minute survey. Click here!

© Copyright codetoad.com 2001-2005