troubleshooting Question

Passing variables to javascript input box

Avatar of SouthDallas40
SouthDallas40 asked on
JavaScriptASP.NETVisual Basic.NET
9 Comments1 Solution1580 ViewsLast Modified:
This should be an easy 500 points for someone. What I need is probably quite simple to do. I have two javascript input boxes that I need to populate with data from my vb.net code behind.
What is the syntax for getting the data from my vb.net variables into the javascript input boxes?
<script runat="server">         
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)        
        Dim username, password As String
        username = somevalue
        password = somevalue             
    End Sub
</script> 
 
    <input name="username" value="exchangetest1" type="hidden" class="txt" id="username" />
    <input name="password" value="12345" type="hidden" class="txt" id="password" onfocus="g_fFcs=0" />	  
<script type="text/javascript">  
  document.forms(0).action='https://email.mycompany.com/CookieAuth.dll?Logon';
  document.forms(0).submit();
 </script>
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 9 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 9 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros