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

Username:   Password: 
 RegisterRegister   
 JavaScript text box 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: Thu Sep 16, 2004 4:50 pm   Post subject: JavaScript text box question..

ok, i've done 2 years of Turing so far, but now i started JavaScript at school...

the teacher made us write a program that tells time and refreshes every second....

anyways, can you please tell me of a way to display that "clock" (just text, nothing else) in a text box?

thanks a lot!
Sponsor
Sponsor
Sponsor
sponsor
Dan




PostPosted: Thu Sep 16, 2004 4:53 pm   Post subject: (No subject)

This is not a fourm for java scripted, this is a forum for the progaming langue java. java scripted != java.

I am moving this to html/webpage section.....
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
wtd




PostPosted: Mon Sep 20, 2004 3:54 pm   Post subject: (No subject)

Create a textbox with HTML and gove it a unique ID. Then simply access that object and set its value property. Something like the following should work, though I haven't tested it.

code:
<html>
<head>
   <script type="text/javascript" language="javascript">
      function displayTest() {
         document.getElementById("test-field").value = "Hello world!";
      }
   </script>
</head>
<body onload="displayTest();">
   <form>
      <input type="text" id="test-field"/>
   </form>
</body>
</html>
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  [ 3 Posts ]
Jump to:   


Style:  
Search: