Author Topic: Auto filled-field.  (Read 674 times)

Offline ricardokb

  • Level 5
  • *
  • Posts: 18
  • Reputation: +0/-0
    • View Profile
Auto filled-field.
« on: January 15, 2010, 04:07:52 PM »
Hi all, I've got into an interrogate.

Is there any way to do something like this?:

To have 2 different fields in one page.

1st field.- This is an input text, where you cant write whatever you want.
2nd field.- All what's being written inside the 1st field, will be displayed in here. At the same time.

Just like if you were typing both fields at the same time.
 

Offline Bryan

  • Level 7
  • *
  • Posts: 32
  • Reputation: +2/-0
    • View Profile
Re: Auto filled-field.
« Reply #1 on: January 15, 2010, 04:16:08 PM »
A little javascript, eh? Maybe something like this: http://www.webmasterworld.com/forum21/10305.htm

Offline Harkins

  • Level 28
  • **
  • Posts: 424
  • Reputation: +11/-2
  • Coder, blogger, entrepreneur.
    • View Profile
    • Push CX - Blog
Re: Auto filled-field.
« Reply #2 on: January 15, 2010, 04:50:05 PM »
With jQuery (off the top of my head and untested):

Code: (javascript) [Select]
// on every keypress, copy value over
$("#firstinput").keypress(function () {
  $("#secondinput").val($(this).val());
});

Visit #bbg on irc.freenode.net to talk browser games anytime.

 


SimplePortal 2.3.3 © 2008-2010, SimplePortal