Web Analytics Made Easy -
StatCounter How to use javascript variable in a form - CodingForum

Announcement

Collapse
No announcement yet.

How to use javascript variable in a form

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to use javascript variable in a form

    Hi,

    i just wanna knw to access javascript variable in the form


    Suppose,

    in the script a=10;

    i want to show the value of the variable in the form

    such as

    <input type=text value=????>

    just tell me the statement which i have to use near value ?????

    also whether it is possible to get javascript variable in the form or not ???

    Reply me.. soon...
    Very urgent

    also send ur ans to my mail : [email protected]

  • #2
    There are many ways of doing this:

    PHP Code:
    document.write('<input type=text value='+a+'>'); 
    or

    PHP Code:
    <input type=text value="" id="textfield">
    document.getElementById('textfield').value a
    so happy, so cool

    http://coolersport.info

    Comment

    Working...
    X