Solved

Request.Form returns empty

Posted on 2013-01-12
10
793 Views
Last Modified: 2013-01-12
Hello Experts,

Can anyone give me any ideas why would Request.Form not return anything? All my control names are spelled correctly (I used copy/paste), but I cannot think of what could be the issue?

I have recently installed Visual Studio 2010 on my computer, could that be conflicting in any way? What else can I check?

Thank you,
0
Comment
Question by:APD_Toronto
  • 5
  • 4
10 Comments
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 250 total points
ID: 38770659
You would have to show us your code for us to help you figure what is wrong.
0
 

Author Comment

by:APD_Toronto
ID: 38770716
tax1 returns empty at Respone.Wrie

<%@ Language=VBScript %>

<!-- #include file="../includes/common.asp" -->
<!-- #include file="../includes/checklogin.asp" -->
<!-- #include file="../includes/functions.asp" -->
<!-- #include file="../includes/AdminPageSetup.asp" -->

<%
	strAction = Injection(Request.QueryString("action"))

	If strAction = "save" Then
	
		'Request Prices
		
		
		'Request Taxes
		  
		  '***TAX 1***
		  
			strTaxName1 = (Request.Form("txtTaxName1"))
			strTaxRate1 = Injection(Request.Form("txtTaxRate1")) 
			
			If Injection(Request.Form("chkTaxActive1")) = "1" Then
			
				strTaxActive1 = True
			
			Else
			
				strTaxActive1 = False
			
			End If
		
		  '***TAX 2***
		  
			strTaxName2 = Injection(Request.Form("txtTaxName2"))
			strTaxRate2 = Injection(Request.Form("txtTaxRate2")) 
			
			If Injection(Request.Form("chkTaxActive2")) = "1" Then
			
				strTaxActive2 = True
			
			Else
			
				strTaxActive2 = False
			
			End If
			
		'***TAX 3***
		  
			strTaxName3 = Injection(Request.Form("txtTaxName3"))
			strTaxRate3 = Injection(Request.Form("txtTaxRate3")) 
			
			If Injection(Request.Form("chkTaxActive3")) = "1" Then
			
				strTaxActive3 = True
			
			Else
			
				strTaxActive3 = False
			
			End If
		
		Response.Write("tax1 =" & strTaxName1)
			
		'Call Save
	
	Else
		
		strMSG = "Your changes have been cancelled."
		
	End If

Open in new window

0
 
LVL 30

Expert Comment

by:Wayne Barron
ID: 38770720
As long as you have something like this, you should be good to go.
However, like Dave pointed out, if you do have code like this, then we will need to see and no more.

(Just copy and paste into a new file, name it Q_27993404.asp
And then run it.
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<%getSub = request.Form("Submit")
if request.Form("Submit")="Send Data" then
fname = request.Form("FName")
lname = request.Form("LName")
response.Write "You entered <strong>"&fname&" "&lname&"</strong> as your name"
end if
%>
<form action="Q_27993404.asp" method="post" name="Process">
<input type="text" name="FName" />
<input type="text" name="LName" />
<input type="submit" name="Submit" value="Send Data" />
</form>
</body>
</html>

Open in new window


Carrzkiss
0
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 

Author Comment

by:APD_Toronto
ID: 38770723
My test is Li. 63

My HTML form is below, but could this be related as well: http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/ASP/Q_27993401.html

HTML
<%@ Language=VBScript %>

<!-- #include file="../includes/common.asp" -->
<!-- #include file="../includes/checklogin.asp" -->
<!-- #include file="../includes/functions.asp" -->
<!-- #include file="../includes/AdminPageSetup.asp" -->

<%
Call openDB
Set rs = Server.CreateObject("ADODB.Recordset")
With rs

	strSQL = "SELECT * FROM tblTaxes ORDER BY fldID ASC;"
	.Open strSQL, cnn
	
		.MoveFirst 'TAX1
		
			strTaxName1 = .Fields("fldName")
			strTaxRate1 = CDbl(.Fields("fldRate")) * 100
			strTaxActive1 = .Fields("fldActive")
			
		.MoveNext 'TAX2
		
			strTaxName2 = .Fields("fldName")
			strTaxRate2 = CDbl(.Fields("fldRate")) * 100
			strTaxActive2 = .Fields("fldActive")
	
		.MoveNext 'TAX3
		
			strTaxName3 = .Fields("fldName")
			strTaxRate3 = CDbl(.Fields("fldRate")) * 100
			strTaxActive3 = .Fields("fldActive")
	.Close
End With
Set rs = Nothing
Call closeDB
%>

<%Call getHeader%>
	
	<h1> <center> Prices & Taxes </center> </h1>

<form method="POST" action="changeRates-save.asp?action=save" name="frm" onSubmit="return validate();" enctype="multipart/form-data">

<center>

	

</center>
<b><i> *IMPORTANT: All above prices should be pre-tax and pre-promo, including pre-1111.</i></b>

<br> &nbsp;<br> &nbsp;

<center>

<table width="50%"> <!--REDUCE LATER-->
	
	<tr>
		<td width="25%"> &nbsp; </td>
		<td width="25%" bgcolor="#C0C0C0" align="center"> <b> Tax #1 </b> </td>
		<td width="25%" bgcolor="#C0C0C0" align="center"> <b> Tax #2 </b> </td>
		<td width="25%" bgcolor="#C0C0C0" align="center"> <b> Tax #3 </b> </td>
	</tr>
	
	<tr>
		<td> Name: </td>
		<td> <input type="text" size="5" name="txtTaxName1" id="txtTaxName1" value="<%=strTaxName1%>" /> </td>
		<td> <input type=text size=5 name="txtTaxName2" id="txtTaxName2" value="<%=strTaxName2%>"> </td>
		<td> <input type=text size=5 name="txtTaxName3" id="txtTaxName3" value="<%=strTaxName3%>"> </td>
	</tr>
	
	<tr>
		<td bgcolor="#C0C0C0"> Rate: </td>
		<td bgcolor="#C0C0C0"> <input type=text size=5 name="txtTaxRate1" id="txtTaxRate1" value="<%=strTaxRate1%>"> % </td> 
		<td bgcolor="#C0C0C0"> <input type=text size=5 name="txtTaxRate2" id="txtTaxRate2" value="<%=strTaxRate2%>"> % </td> 
		<td bgcolor="#C0C0C0"> <input type=text size=5 name="txtTaxRate3" id="txtTaxRate3" value="<%=strTaxRate3%>"> % </td> 
	</tr>
	
	<tr>
		<td> Active: </td>
		
		<td>
			<input type=checkbox name="chkTaxActive1" id="chkTaxActive1" value=1
				
				<%If CBool(strTaxActive1) Then Response.Write("checked")%> >
			
		</td>
		
		<td>
			<input type=checkbox name="chkTaxActive2" id="chkTaxActive2" value=1
				
				<%If CBool(strTaxActive2) Then Response.Write("checked")%> >
			
		</td>
		
		<td>
			<input type=checkbox name="chkTaxActive3" id="chkTaxActive3" value=1
				
				<%If CBool(strTaxActive3) Then Response.Write("checked")%> >
			
		</td>
	</tr>

<table>

</center>
<b><i> *IMPORTANT: Inactive (un-checked) tax rates will NOT be charged.</i></b>


<br> &nbsp;<br> &nbsp;
<center>

	<INPUT type="submit" value="Save Changes" id=submit1 name=submit1> &nbsp; &nbsp; 
	<INPUT type="button" value="Cancel Changes" onClick="cancelChanges();" id=button1 name=button1>

</center>
<br> &nbsp;<br> &nbsp;

</form>

<%Call getFooter%>

<script type="text/javascript">

function validate()
{

	alert ('is everything validated?');
	return true;
}

function cancelChanges()
{
	if (confirm("Are you sure you want to cancel these changes?")) 
	{
		self.location = "changeRates-save.asp?action=cancel";
	}
}

</script>

Open in new window

0
 
LVL 30

Assisted Solution

by:Wayne Barron
Wayne Barron earned 250 total points
ID: 38770724
The best thing that I can suggest is that you try bit by bit.

Try the first field by itself.

make sure that it is going through on its own, and then move on from there.

Example:
strAction = Request.QueryString("action")
response.write strAction

See what happens, have it by itself,
0
 

Author Comment

by:APD_Toronto
ID: 38770729
strAction = Request.QueryString("action") works as i get
tax1 =
On my screen, meaning Li. 63 executes
0
 
LVL 30

Expert Comment

by:Wayne Barron
ID: 38770732
As for the JIT, I am not sure if it will have anything to do with it.
As I had Visual Studio 2010 installed back mid-last year, and did not experience any issues with my classic ASP projects.
0
 
LVL 30

Expert Comment

by:Wayne Barron
ID: 38770736
So you are saying the running the test works, and you get back a result.
If that is true, then try it with your header of the file, and then include the protection
strAction = Injection(Request.QueryString("action"))
And try it again.
You want to test everything, to make sure that it all passes.
Then you can start looking into your other code on that page, to see if something else is stopping it from going through.

p.s.
It seems we are posting on top of each others comments :)
0
 

Author Comment

by:APD_Toronto
ID: 38770738
I removed   enctype="multipart/form-data" and it worked.
0
 
LVL 30

Expert Comment

by:Wayne Barron
ID: 38770751
Sometimes it is the little things.
Do you know what you was using that for?
As it might be needed on something, however, you can place it elsewhere, besides where you initially had it at.

Glad you got it working.
Carrzkiss
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question