Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 active textfield question
Index -> Graphics and Design, Web Design -> (X)HTML Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
who cares?




PostPosted: Tue Nov 09, 2004 5:36 pm   Post subject: active textfield question

i have more than 1 textfield on a page at one time and i want to output something to the textfield that is active at that particular time...

can someone please tell me what the code is to do that? maybe there's a command to get the status of the textfield (active or innactive i mean)

thanks! Very Happy
Sponsor
Sponsor
Sponsor
sponsor
Blade




PostPosted: Sun Nov 14, 2004 12:45 am   Post subject: (No subject)

use javascript... and please try to be clearer when asking a question cuz i dont really know what you mean...

if your page has multiple forms, then change the number in "forms[0]"
forms are stored in an array, obviously the first form on the page will be the 0th element in the array...

AND i'm not sure what yer askin so.. this one will update the second box with whatever is in the first box...

code:
<head>
  <script language="JavaScript">
   <!--
    function changevalue(){
       var field = document.forms[0].secondfield;
       var firstfield = document.forms[0].firstfield;
       field.value = firstfield.value;
    }
    -->
    </script>
</head>

<form name="formone">
  <input type="text" name="firstfield" onKeyPress="javascript: changevalue();">
  <input type="text" name="secondfield" value="">
</form>


if this isnt what you're looking for... please rephrase your question and be more specific
Display posts from previous:   
   Index -> Graphics and Design, Web Design -> (X)HTML Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: