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 to the CF scene
    Join Date
    Oct 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Newbie, help required

    Dear All,
    Firstly thank you for looking at my post, and am hoping you would review and help me out.

    what I am trying to do is:
    1) Create a form which captures username, domain using objuserinfo.username and objuserinfo.userdomain

    Things work well till here - I am able to get my form with values populated.

    When i submit that form and the new asp page does not recognize the form values and would return null values.




    Code:
    <html>
    <head>
    <title>Sample module</title>
    
    <body>
    <br><br>
    
    <form name="formname" method="post" action="framework.asp">
     <table id="tblMain" align="center" cellPadding="0" cellSpacing="0">
    	  <tr>
    		  <td colSpan="3">
    		  <table cellPadding="0" cellSpacing="0" class="tblLgn">
    			  <tr>
    				  <td class="lgnTL"><img alt="" src="images/lgntopl.gif"></td>
    				  <td class="lgnTM"></td>
    				  <td class="lgnTR"><img alt="" src="images/lgntopr.gif"></td>
    			  </tr>
    		  </table>
    		  </td>
    	  </tr>
    	  <tr>
    		  <td id="mdLft">&nbsp;</td>
    		  <td id="mdMid">
    		  <table class="mid">
    			  <tr>
    				  <td><hr></td>
    				  <td>&nbsp;</td>
    			  </tr>
    			  <tr>
    				  <td id="tdMsg" class="auto-style2">Your identity has been obtained from your login 
    				  credentials.</td>
    				  <td id="tdMsg">&nbsp;</td>
    			  </tr>
    			  <tr>
    				  <td class="auto-style2"><hr></td>
    				  <td>&nbsp;</td>
    			  </tr>
    			  <tr>
    				  <td class="auto-style2">Computer Name</td>
    				  <td><input id="code" name="code" disabled="disabled" type="text" >&nbsp;</td>
    			  </tr>
    			  <tr>
    				  <td style="height: 17px" class="auto-style2">Domain</td>
    				  <td style="height: 17px">
        <input id="udomain" disabled="disabled" name="udomain" type="text" ></td>
    			  </tr>
    			  <tr>
    				  <td class="auto-style2">Username</td>
    				  <td>
        <input id="uname" name="uname" disabled="disabled" type="text" ></td>
    		  </tr>
    			  <tr>
    				  <td class="r">
    				  &nbsp;</td>
    				  <td class="r">&nbsp;</td>
    			  </tr>
    		  </table>
    		  <table class="mid tblConn">
    			  <tr>
    				  <td align="right" class="tdConnImg" rowSpan="2">
    				  <img alt="" src="images/lgnexlogo.gif"></td>
    				  <td class="r">&nbsp;<input id="btnCls" type="submit" class="auto-style1" type="submit" value="Launch Page !!"></td>
    			  </tr>
    			  <tr>
    				  <td class="tdCopy">&nbsp;</td>
    			  </tr>
    		  </table>
    		  </td>
    		  <td id="mdRt">&nbsp;</td>
    	  </tr>
    	  <tr>
    		  <td colSpan="3">
    		  <table cellPadding="0" cellSpacing="0" class="tblLgn">
    			  <tr>
    				  <td class="lgnBL"><img alt="" src="images/lgnbotl.gif"></td>
    				  <td class="lgnBM"></td>
    				  <td class="lgnBR"><img alt="" src="images/lgnbotr.gif"></td>
    			  </tr>
    		  </table>
    		  </td>
    	  </tr>
      </table>
    </form>
    
    <script>
    var codeElem = document.getElementById('code')
    var codeuname = document.getElementById('uname')
    var codedomain = document.getElementById('udomain')
    
    var text = "";
    var objUserInfo = new ActiveXObject("WScript.network");
        codeElem.value = objUserInfo.ComputerName;
        codeuname.value = objUserInfo.UserName;
        codedomain.value = objUserInfo.UserDomain;
    </script>

    This form is generated well, it gives me all 3 fields with values populated correctly. When I click on submit button (or launch file button) - it calls a new page "framework.asp" - all I am doing in framework.asp is,

    PHP Code:
    <%
    dim newuname
    newuname 
    request.form("uname")
    %>
    <%=
    newuname%> 
    It gives me a null value. form values from the previous file are not being passed.

    can any one help me please????

    Your help would be much appreciated.
    Last edited by VIPStephan; 10-08-2012 at 11:07 PM. Reason: added code BB tags

  • #2
    Regular Coder
    Join Date
    Apr 2012
    Location
    St. Louis, MO
    Posts
    985
    Thanks
    7
    Thanked 101 Times in 101 Posts
    Please post all code between CODE tags.

    This is not the forum for asking questions, this is for posting completed, working code that others might find helpful.

    I'm sure a moderator will move this thread to the appropriate forum, at some point. Just a heads-up.

    PS.. form elements that are disabled do not pass their value to the processing page.
    ^_^

    If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.
    *
    The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".

  • #3
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,925
    Thanks
    6
    Thanked 1,040 Times in 1,013 Posts
    I don’t see how this has anything to do with JavaScript at all. Moved to ASP forum.


  •  

    Posting Permissions

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