Current location: Hot Scripts Forums » General Web Coding » JavaScript » onBlur question


onBlur question

Reply
  #1 (permalink)  
Old 03-15-05, 04:53 PM
NixMaster NixMaster is offline
Account Disabled
 
Join Date: Feb 2005
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
onBlur question

I'm using onBlur to copy fields to other fields. in the code

Code:
<SCRIPT TYPE="text/javascript" LANGUAGE="Javascript1.1">
function fillbox2(f) {
   f.sport.value = f.port.value;
   f.login.value = f.port.value;
}
when copying port to login I need it to add a v in front of it.

For example, port = 3333, the output to login would need to be v3333.

Any help on this? Thanks
Reply With Quote
  #2 (permalink)  
Old 03-15-05, 05:38 PM
TwoD TwoD is offline
Community VIP
 
Join Date: Sep 2003
Location: 404
Posts: 1,813
Thanks: 0
Thanked 0 Times in 0 Posts
Code:
function fillbox2(f) {
   f.sport.value = f.port.value;
   f.login.value = "v"+f.port.value;
}
JavaScript is a "loosely" typed language, which means it'll automatically convert integers to strings (for example) if you add characters to them.
Reply With Quote
  #3 (permalink)  
Old 03-15-05, 05:57 PM
NixMaster NixMaster is offline
Account Disabled
 
Join Date: Feb 2005
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Thank you :-D
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
a question on favicon.ico darkcarnival The Lounge 0 01-01-05 05:25 PM
Posting a question / answer on site markcody PHP 2 11-23-04 01:58 PM
[PHP] Array question UmiSal Script Requests 1 04-05-04 01:52 PM
question and answer software jaydifox C/C++ 0 02-21-04 09:26 AM
Perl-PHP software Copyright question! kevin PHP 8 10-29-03 08:03 AM


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