Current location: Hot Scripts Forums » General Web Coding » JavaScript » a dynamic textfield ??


a dynamic textfield ??

Reply
  #1 (permalink)  
Old 03-31-04, 12:20 AM
nurqeen nurqeen is offline
New Member
 
Join Date: Feb 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
a dynamic textfield ??

hi...

is there possible to make a dynamic texfield?? mean when key-in the data in the first textfield, the 2nd textfield will display a match input with the first textfield..

eg: we type 1 in the first textfield, then the second textfield will display 'one' if we type 2, 2nd textfield will display 'two' and so on..

i don't want to use drop down menu for this..

please help..thanxx...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 03-31-04, 02:53 AM
TwoD TwoD is offline
Community VIP
 
Join Date: Sep 2003
Location: 404
Posts: 1,813
Thanks: 0
Thanked 0 Times in 0 Posts
Yes that's possible, depending on how flexible you want it to be.

There is no function in Javascript that will turn numbers into the correct word but you could create a simple function like that easily.

Just make an array with the text-version of all numbers you want the user to be able to put in the box,
then you make a small function which grabs the input field's value and uses it like an index to print out a word.

<script>
function NumberToWord(){
var textNumbers = new Array("zero","one","two","three","four","five")
var input=parseInt(document.getElementById("input_fiel d"))
if(input<textNumbers.length){
document.getElementById("output_field").value=text Numbers[input]
}
}
</script>
<input type="text" name="input_field" onChange="numberToWord()">
<input type="text" name="output_field">
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
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
dynamic forms fadi PHP 1 02-19-04 03:40 AM
Wow, a dynamic menu, error! Programme PHP 3 01-05-04 03:16 PM
How to clear the history of a textfield? pschwar JavaScript 1 11-10-03 04:38 PM
PHP - script for dynamic daily text...HELP! fpardi PHP 3 10-13-03 04:02 AM
dynamic uploader (progress bar) [PL]Greg PHP 8 07-02-03 01:07 PM


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