Current location: Hot Scripts Forums » General Web Coding » JavaScript » return; not breaking out of the function


return; not breaking out of the function

Reply
  #1 (permalink)  
Old 06-18-04, 09:23 AM
CraigDavids CraigDavids is offline
New Member
 
Join Date: Jun 2004
Location: Cape Town
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Question return; not breaking out of the function

OK, heres the deal. Got a multiline <asp:textbox> where the user can enter a description. Problem that I found is that one cannot put a maxlength on a multiline <asp:textbox>.

So Wot i've done(bit of a hack) is bind a custom JS CheckFieldLength() event to the onPaste, onKeypress and onChange events of the control which simply looks like this:

//Constants to force maxlength on a multi-line textbox
//had to resort to this coz on cant put a maxlength on a
//Multiline asp:textbox!
//-------------------------------
var giCommentLength = 500;
//-------------------------------
function CheckFieldLength(vValue) {
if(vValue.length > giCommentLength) {
return false;
}
}

This just refuses to work. Any ideas?

Thanks!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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 On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Disable form fields to be submitted RickyRod JavaScript 2 05-24-04 10:15 AM
calendar working until months changed bitesize JavaScript 1 01-13-04 01:50 PM
Upload file to table so ONLY files tied to primary key are displayed in record? grafixDummy PHP 4 12-20-03 04:28 PM
changing a specific dateformat in tigra bitesize JavaScript 0 10-30-03 08:58 AM
Help trim code down TheLaughingBandit JavaScript 0 09-02-03 09:50 AM


All times are GMT -5. The time now is 10:24 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.