Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 30th, 2004, 01:06 AM
Authorized User
 
Join Date: Jan 2004
Location: , , .
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
Default textbox Maxlength problem

I am facing a strange problem in my ASP Page.
I want to specify the maxlength of a text box to 30 as the corresponding database field length is 30. However, this restricts the length of string entered to 12! If i make it 49, THEN maxlength is actually 30. Following is the code for the textbox in question:

<td align=left><input type="text" id = "txtBhawanName" name = "txtBhawanName" size=30 maxlength=49 value='<%=rsTempAdd.fields("B_BhawanName").value%> '></td>

What to do?

Thanks
Ashu
Reply With Quote
  #2 (permalink)  
Old May 3rd, 2004, 07:40 AM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi there,

Where do you notice the maxlength? When typing text in the text box or on the server side?

If you're having troubles with the browser side, you should realize that maxlength just limits the number of characters, not the way they are displayed. So, when you type a lot of i characters, you'll run out of characters before the text box is full. If you type the w character instead, the box will look full pretty quick, but you can still type more characters.

Is this the behavior you're encountering? if not, can you please elaborate a bit? Maybe even link to a working page with the problem?

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Desaparecido by Manu Chau (From the album: Clandestino) What's This?
Reply With Quote
  #3 (permalink)  
Old May 6th, 2004, 12:49 AM
Authorized User
 
Join Date: Jan 2004
Location: , , .
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Imar!

The maxlength is giving a problem in the browser, IE.

I want only 30 (any) characters to be entered in the textbox in question.

What i am facing is that although the textbox maxlength=30, EVEN THEN i am able to enter only 12 characters.

However, IF i specify maxlength=49, THEN i am able to enter 30 characters, not otherwise.

I hope i am clearer this time!

Thanks
Ashu

Reply With Quote
  #4 (permalink)  
Old May 6th, 2004, 02:06 AM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

But that is what I meant with my previous post: You may suffering from a visibility problem in the text box. As soon as you type more characters, the stuff you already typed in will scroll out of view, but they are still there. Instead of typing the same character, type 1234567890 and keep repeating that.
IMO, you're not clearer now as you're not really providing more information, but merely repeating the initial post, so it's hard to tell what's going on.

Is there a live page somewhere that we can look at? Maybe upload it somewhere for us to test?

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Where Is My Mind? by The Dust Brothers (Track 17 from the album: Fight Club) What's This?
Reply With Quote
  #5 (permalink)  
Old May 6th, 2004, 03:41 AM
Authorized User
 
Join Date: Jan 2004
Location: , , .
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I have tried typing in 123456789123 . This makes it 12 characters in all. This is all that i can enter. Visibility is not a problem as the textbox size is 30.

Sorry Imar, i can't post the web page anywhere. No such place available.

Reply With Quote
  #6 (permalink)  
Old May 6th, 2004, 03:48 AM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

This is so weird.

Instead of posting the ASP server side code, can you post the HTML code for the page as it appears in the browser?

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Sweet Sixteen by Billy Idol (Track 8 from the album: 11 Of The Best) What's This?
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
VB .Net TextBox MaxLength Mocha Visual Studio 2005 1 October 10th, 2007 08:35 AM
textbox MaxLength akumarp2p C# 2005 1 December 27th, 2006 06:31 AM
Changing maxlength in JScript BrianWren Javascript How-To 2 June 20th, 2006 03:11 PM
maxLength property crmpicco HTML Code Clinic 2 July 7th, 2005 06:53 AM
textbox cutting off text? but maxlength is 10,000? ALEX_GRIM Classic ASP Basics 3 February 6th, 2005 08:47 AM



All times are GMT -4. The time now is 07:12 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.