CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   ASP.NET (http://www.codingforums.com/forumdisplay.php?f=40)
-   -   Newbie, help required (http://www.codingforums.com/showthread.php?t=275777)

rajuasq 10-08-2012 08:29 PM

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.

WolfShade 10-08-2012 08:37 PM

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.

VIPStephan 10-08-2012 10:09 PM

I don’t see how this has anything to do with JavaScript at all. Moved to ASP forum.


All times are GMT +1. The time now is 03:07 AM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.