Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

how do you out put Javascript inside text box?

How in the heck do you do this? Is it even possible? I've scoured the internet on how to do it (and I'm pretty good at finding things) but apparently no info exists?

Basically, I want to take a simple cookie counter

(particularly located here - http://www.cookiecentral.com/code/jc2.htm)

and incorporate that into a text box. I have to process a lot of forms for my job, and I thought that instead of typing a sequential id number each time (then submitted it into a SQL database), I could open up the form (HTML file) and have it auto count for me. I know there are probably easier ways to do this/better software, but changing our entry system/method is not an option. Please help! Anything you can provide would be greatly appreciated!

2 Answers

Relevance
  • 5 years ago

    you may positioned besides the fact which you like interior an echo assertion. so a ways because of the fact the own dwelling house page is worried that's merely textual content textile, and, so a ways because of the fact the browser is worried, it would desire to in uncomplicated terms as particularly be coming from a static HTML web site.

  • 1 decade ago

    All you have to do is write a function that sets the value of the text input field.

    So you'd have something like :

    function countMe(currentCount) {

    document.getElementById( "myFieldID" ).value = currentCount;

    }

    < form >

    < input id="myFieldID" type="text" />

    < /form >

Still have questions? Get your answers by asking now.