variables and html

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John Wilson

    variables and html

    I have a javascript variable with a value and I would like a hidden
    html text box to contain that value. How can I assign the textbox
    value to the javascript variable's value?
  • Laurent Bugnion, GalaSoft

    #2
    Re: variables and html

    Hi,

    John Wilson wrote:
    [color=blue]
    > I have a javascript variable with a value and I would like a hidden
    > html text box to contain that value. How can I assign the textbox
    > value to the javascript variable's value?[/color]

    If you have

    <INPUT TYPE="hidden" NAME="myHidden" ID="myHidden" VALUE="">

    then you can do

    document.formNa me.myHidden.val ue = myJavaScriptVar iable;

    HTH,

    Laurent
    --
    Laurent Bugnion, GalaSoft
    Webdesign, Java, JavaScript: http://www.galasoft-LB.ch
    Private/Malaysia: http://mypage.bluewin.ch/lbugnion
    Support children in Calcutta: http://www.calcutta-espoir.ch

    Comment

    • kaeli

      #3
      Re: variables and html

      In article <41a360b5.03090 90433.1b77d219@ posting.google. com>,
      jwilson@exeter. edu enlightened us with...[color=blue]
      > I have a javascript variable with a value and I would like a hidden
      > html text box to contain that value. How can I assign the textbox
      > value to the javascript variable's value?
      >[/color]

      document.formNa me.hiddenName.v alue = myVariable;


      -------------------------------------------------
      ~kaeli~
      Press any key to continue or any other key to quit.
      Who is General Failure and why is he reading
      my hard disk?


      -------------------------------------------------

      Comment

      • John Wilson

        #4
        Re: variables and html

        Thanks, it's working. I had similiar code but there was a typo! Thanks
        again!!

        *** Sent via Developersdex http://www.developersdex.com ***
        Don't just participate in USENET...get rewarded for it!

        Comment

        Working...