Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Get value from function and put in textbox

Get value from function and put in textbox

Scheduled Pinned Locked Moved Web Development
javascripthelptutorialquestion
6 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    Ish Kapila
    wrote on last edited by
    #1

    hello folks,this is basically my first question. help me out i have created a system running clock in javascript and am able to display the value on the page by the document property... by calling a function in loop... can u tell me how to display this value in the textbox...the code is

    Ish Kumar Kapila

    J 1 Reply Last reply
    0
    • I Ish Kapila

      hello folks,this is basically my first question. help me out i have created a system running clock in javascript and am able to display the value on the page by the document property... by calling a function in loop... can u tell me how to display this value in the textbox...the code is

      Ish Kumar Kapila

      J Offline
      J Offline
      JUNEYT
      wrote on last edited by
      #2

      Hi! Because you haven't defined a name for the input box. Just define a name such as name="box1" and then use the ID with document.form.box1.value statement in the function.

      I 1 Reply Last reply
      0
      • J JUNEYT

        Hi! Because you haven't defined a name for the input box. Just define a name such as name="box1" and then use the ID with document.form.box1.value statement in the function.

        I Offline
        I Offline
        Ish Kapila
        wrote on last edited by
        #3

        sorry buddy it did not worked... see the new code help me guys... Ish Kumar Kapila

        J 1 Reply Last reply
        0
        • I Ish Kapila

          sorry buddy it did not worked... see the new code help me guys... Ish Kumar Kapila

          J Offline
          J Offline
          JUNEYT
          wrote on last edited by
          #4

          If you define a form object it can work out. After tag define a form object

          I 1 Reply Last reply
          0
          • J JUNEYT

            If you define a form object it can work out. After tag define a form object

            I Offline
            I Offline
            Ish Kapila
            wrote on last edited by
            #5

            Still nothing happened buddy. is the problem so complex to solve.. plz try again ... thanx for the effort try something new Ish Kumar Kapila

            J 1 Reply Last reply
            0
            • I Ish Kapila

              Still nothing happened buddy. is the problem so complex to solve.. plz try again ... thanx for the effort try something new Ish Kumar Kapila

              J Offline
              J Offline
              JUNEYT
              wrote on last edited by
              #6

              Hi! I just fixed the code for you. There were a few mistakes. Copy and paste the whole code below in to a page and then load the page. I have checked it and it is working... :) New Page 1 function time() { var d=new Date() var h=d.getHours() var m=d.getMinutes() var s=d.getSeconds() var ms=d.getMilliseconds() document.getElementById('txt').innerHTML=h+":"+m+":"+s+":"+ms t=setTimeout('time()',50) document.form.tbox.value=t }

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups