Go Back   CodingForums.com > :: Server side development > ASP.NET

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-08-2012, 08:29 PM   PM User | #1
rajuasq
New to the CF scene

 
Join Date: Oct 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
rajuasq is an unknown quantity at this point
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 10:07 PM.. Reason: added code BB tags
rajuasq is offline   Reply With Quote
Old 10-08-2012, 08:37 PM   PM User | #2
WolfShade
Regular Coder

 
Join Date: Apr 2012
Location: St. Louis, MO, USA
Posts: 941
Thanks: 7
Thanked 95 Times in 95 Posts
WolfShade is an unknown quantity at this point
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".
WolfShade is online now   Reply With Quote
Old 10-08-2012, 10:09 PM   PM User | #3
VIPStephan
The fat guy next door


 
VIPStephan's Avatar
 
Join Date: Jan 2006
Location: Halle (Saale), Germany
Posts: 7,587
Thanks: 5
Thanked 864 Times in 841 Posts
VIPStephan is a jewel in the roughVIPStephan is a jewel in the roughVIPStephan is a jewel in the rough
I don’t see how this has anything to do with JavaScript at all. Moved to ASP forum.
__________________
Don’t click this link!
VIPStephan is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:55 PM.


Advertisement
Log in to turn off these ads.