Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Oct 2006
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    javascript help please

    Can you help me with some javascript please.

    So far I have some code to return a value from a java applet into a readonly textfield.

    Basically what I need is when the submit button is pressed the document.applets[0].getLHost()); gets the value from the applet and passes it to a hidden textfield which is then posted to the next page.

    I think the document.applets[0].getLHost()); needs to be used in some onSubmit code in the header. And then that value is dynamically updated in the hidden field. but not sure how to do this
    Any help is greatly appreciated.



    Code:
    <applet code="support" width="500" height="600" align="top">
    </applet>
    
    <form name="form1" method="post" action="nextpage.asp">
    <script type="text/javascript">
    <!--
    document.write('<input type="text" name="textField" readonly value="');
    document.write(document.applets[0].getLHost());
    document.write('">');
    //-->
    </script>
    <input name="Submit" type="button" value="Submit">

  • #2
    New Coder
    Join Date
    Oct 2006
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Im thinking it should be something like this but ist not working.. if anyone can help?

    Code:
    <head>
    <script language="JavaScript"> 
    <!-- 
    function getValue(obj){
    var textBox = document.getElementById (obj)
    textBox.value =document.applets[0].getLHost();
    }
     //-->
    </script>
    </head>
    
    <applet code="support" width="500" height="600" align="top">
          </applet>
    
    
    <form name="form1" method="post" action="nextpage.asp" onsubmit="getValue('SumBox')">
    
    <input type="text" name="Price" id="SumBox" value="0" size="5" readonly>
    <input name="More Info" type="button" value="More Info">
    </form>

  • #3
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Can you post a link to the page? Are you sure you are even getting a value from the applet? Try alerting the applet value.
    ||||If you are getting paid to do a job, don't ask for help on it!||||


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •