Caling JavaScript with values derived from Web Page.

Discussion in 'JavaScript' started by TimTree, Jan 15, 2007.

  1. #1
    Good Morning,

    I have recently written some JavaScript that is being called by a VB.NET web page. The following is the command to call it:

    <INPUT Type="button" name"timbutton" VALUE"Click Here" onclick"WriteToFile();">


    I now want to call the same javascript method esxcept with a few parameters. On the webpage there are 2 labels, I want to pass through the text from the label into the javascript function.

    Does anybody know how I can extract the value and pass it in the VB.NET webpage HTML ?


    Thanks
    Tim.
     
    TimTree, Jan 15, 2007 IP
  2. ccoonen

    ccoonen Well-Known Member

    Messages:
    1,606
    Likes Received:
    71
    Best Answers:
    0
    Trophy Points:
    160
    #2
    make sure their is equal signs between the name= and the value= and the onclick=.

    Find the labels ID:
    <body onload="YourJSFunction(document.getElementById("labelName").innerHTML);">
     
    ccoonen, Jan 15, 2007 IP