473,699 Members | 2,479 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Cannot grab some of the values from a form

Hi, I got a simple form where one needs to input data. The data
is being processed in an asp page.
However, I cannot figure out why couple of values I am typing in the form
is not being retrived in the asp processing page. Instead it shows as a null
value.

Any help is appreciated. I have attached the major code for the form, the
processing page
and output on the screen including sql output.
Any help is appreciated. Regards.

FORM CODE:

<TABLE border = 0 width= "80%" >
<TR>
<TD>
<INPUT id=chk_0
name = chk_0
type = hidden>
<B><Font size = 2 color=darkblue> Add</font></B>
</TD>
<TD>
<INPUT type = "text" size = 12
value = ""
name = "ID_0"
style = "FONT-SIZE: 10">
</TD>
<TD>
<INPUT type = "text" size = 12
value = ""
name = "date_0"
style = "FONT-SIZE: 10">
</TD>
<TD>
<INPUT type = "text" size = 12
value = ""
name = "contractedserv iceexpense_0"
style = "FONT-SIZE: 10">
</TD>
<TD>
<INPUT type = "text" size = 12
value = ""
name ="travelexpense _0"
style = "FONT-SIZE: 10">
</TD>
<TD>
<INPUT type = "text" size = 12
value = ""
name = "personnelexpen se_0"
style = "FONT-SIZE: 10">
</TD>
</TR>
</table>
PROCESSING CODE:

l_ENO = Request.Form("I D_0")

Response.Write l_ENO & "<br>"
l_Date = Request.Form("d ate_0")

Response.Write l_Date & "<br>"


l_ContracedServ iceExpense =
Request.Form("c ontractedservic eexpense_0")

Response.Write l_contractedser viceexpense
l_TravelExpense = Request.Form("t ravelexpense_0" )

Response.Write l_travelexpense & "<br>"
l_PersonnelExpe nse = Request.Form("p ersonnelexpense _0")

Response.Write l_personnel & "<br>"

'Create the UPDATE SQL STATEMENT

sql = " INSERT INTO tblExpense (ENO, Date,
ContractedServi ceExpense, "
sql = sql & "TravelExpe nse, PersonnelExpens e)"
sql = sql & " VALUES('" & l_ENO & "' , '" & l_Date & "', '" &
l_contractedser viceexpense & "', '" & l_travelexpense & "', '" &
personnelexpens e & "')"
Response.Write sql & "<BR>"
OUTPUT FROM THE PROCESSED ASP PAGE

1
03/29/2005
5


INSERT INTO tblExpense (ENO, Date, ContractedServi ceExpense, TravelExpense,
PersonnelExpens e) VALUES('1' , '03/29/2005', '', '5', '')
Jul 22 '05 #1
2 1504
Jack, again, you really need to use OPTION EXPLICIT at the top of your
pages. Your variable names have typos. Option Explicit would have informed
you of this immediately.

l_ContracedServ iceExpense = Request.Form("c ontractedservic eexpense_0")
^^^
Response.Write l_contractedser viceexpense
^^^

Also, you use "l_personne l" in one spot, but you are giving the form value
to a variable named "l_PersonnelExp ense."
Option Explit would have alerted you to that as well.

Ray at work

"Jack" <Ja**@discussio ns.microsoft.co m> wrote in message
news:E7******** *************** ***********@mic rosoft.com...
Hi, I got a simple form where one needs to input data. The data
is being processed in an asp page.
However, I cannot figure out why couple of values I am typing in the form
is not being retrived in the asp processing page. Instead it shows as a null value.

Any help is appreciated. I have attached the major code for the form, the
processing page
and output on the screen including sql output.
Any help is appreciated. Regards.

FORM CODE:

<TABLE border = 0 width= "80%" >
<TR>
<TD>
<INPUT id=chk_0
name = chk_0
type = hidden>
<B><Font size = 2 color=darkblue> Add</font></B>
</TD>
<TD>
<INPUT type = "text" size = 12
value = ""
name = "ID_0"
style = "FONT-SIZE: 10">
</TD>
<TD>
<INPUT type = "text" size = 12
value = ""
name = "date_0"
style = "FONT-SIZE: 10">
</TD>
<TD>
<INPUT type = "text" size = 12
value = ""
name = "contractedserv iceexpense_0"
style = "FONT-SIZE: 10">
</TD>
<TD>
<INPUT type = "text" size = 12
value = ""
name ="travelexpense _0"
style = "FONT-SIZE: 10">
</TD>
<TD>
<INPUT type = "text" size = 12
value = ""
name = "personnelexpen se_0"
style = "FONT-SIZE: 10">
</TD>
</TR>
</table>
PROCESSING CODE:

l_ENO = Request.Form("I D_0")

Response.Write l_ENO & "<br>"
l_Date = Request.Form("d ate_0")

Response.Write l_Date & "<br>"


l_ContracedServ iceExpense =
Request.Form("c ontractedservic eexpense_0")

Response.Write l_contractedser viceexpense
l_TravelExpense = Request.Form("t ravelexpense_0" )

Response.Write l_travelexpense & "<br>"
l_PersonnelExpe nse = Request.Form("p ersonnelexpense _0")

Response.Write l_personnel & "<br>"

'Create the UPDATE SQL STATEMENT

sql = " INSERT INTO tblExpense (ENO, Date,
ContractedServi ceExpense, "
sql = sql & "TravelExpe nse, PersonnelExpens e)"
sql = sql & " VALUES('" & l_ENO & "' , '" & l_Date & "', '" &
l_contractedser viceexpense & "', '" & l_travelexpense & "', '" &
personnelexpens e & "')"
Response.Write sql & "<BR>"
OUTPUT FROM THE PROCESSED ASP PAGE

1
03/29/2005
5


INSERT INTO tblExpense (ENO, Date, ContractedServi ceExpense, TravelExpense, PersonnelExpens e) VALUES('1' , '03/29/2005', '', '5', '')

Jul 22 '05 #2
Thanks Ray for pointing that out. My bad habits are getting better of my
intentions. Next time probably, I will not end up with the same kind of
'silly' mistake.
Regards.

"Ray Costanzo [MVP]" wrote:
Jack, again, you really need to use OPTION EXPLICIT at the top of your
pages. Your variable names have typos. Option Explicit would have informed
you of this immediately.

l_ContracedServ iceExpense = Request.Form("c ontractedservic eexpense_0")
^^^
Response.Write l_contractedser viceexpense
^^^

Also, you use "l_personne l" in one spot, but you are giving the form value
to a variable named "l_PersonnelExp ense."
Option Explit would have alerted you to that as well.

Ray at work

"Jack" <Ja**@discussio ns.microsoft.co m> wrote in message
news:E7******** *************** ***********@mic rosoft.com...
Hi, I got a simple form where one needs to input data. The data
is being processed in an asp page.
However, I cannot figure out why couple of values I am typing in the form
is not being retrived in the asp processing page. Instead it shows as a

null
value.

Any help is appreciated. I have attached the major code for the form, the
processing page
and output on the screen including sql output.
Any help is appreciated. Regards.

FORM CODE:

<TABLE border = 0 width= "80%" >
<TR>
<TD>
<INPUT id=chk_0
name = chk_0
type = hidden>
<B><Font size = 2 color=darkblue> Add</font></B>
</TD>
<TD>
<INPUT type = "text" size = 12
value = ""
name = "ID_0"
style = "FONT-SIZE: 10">
</TD>
<TD>
<INPUT type = "text" size = 12
value = ""
name = "date_0"
style = "FONT-SIZE: 10">
</TD>
<TD>
<INPUT type = "text" size = 12
value = ""
name = "contractedserv iceexpense_0"
style = "FONT-SIZE: 10">
</TD>
<TD>
<INPUT type = "text" size = 12
value = ""
name ="travelexpense _0"
style = "FONT-SIZE: 10">
</TD>
<TD>
<INPUT type = "text" size = 12
value = ""
name = "personnelexpen se_0"
style = "FONT-SIZE: 10">
</TD>
</TR>
</table>
PROCESSING CODE:

l_ENO = Request.Form("I D_0")

Response.Write l_ENO & "<br>"
l_Date = Request.Form("d ate_0")

Response.Write l_Date & "<br>"


l_ContracedServ iceExpense =
Request.Form("c ontractedservic eexpense_0")

Response.Write l_contractedser viceexpense
l_TravelExpense = Request.Form("t ravelexpense_0" )

Response.Write l_travelexpense & "<br>"
l_PersonnelExpe nse = Request.Form("p ersonnelexpense _0")

Response.Write l_personnel & "<br>"

'Create the UPDATE SQL STATEMENT

sql = " INSERT INTO tblExpense (ENO, Date,
ContractedServi ceExpense, "
sql = sql & "TravelExpe nse, PersonnelExpens e)"
sql = sql & " VALUES('" & l_ENO & "' , '" & l_Date & "', '" &
l_contractedser viceexpense & "', '" & l_travelexpense & "', '" &
personnelexpens e & "')"
Response.Write sql & "<BR>"
OUTPUT FROM THE PROCESSED ASP PAGE

1
03/29/2005
5


INSERT INTO tblExpense (ENO, Date, ContractedServi ceExpense,

TravelExpense,
PersonnelExpens e) VALUES('1' , '03/29/2005', '', '5', '')


Jul 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
7977
by: dan glenn | last post by:
hi. I want to code a 'preview' function into a guestbook entry page. I can do it with a button that posts, bringing up a whole new page showing a preview of what has been entered, and then the user could hit a 'return to entry form' button or some-such and go back to the form. But what I want to do instead is just use an HTML link with some javascript to grab the form's textarea value, and open another browser window that uses a php file...
5
1635
by: M P | last post by:
Hi Team! Hope that you could help me! Its been days since I made this script but I cannot fix the problem! IE is prompting me that there is a Syntax Error but it seems that the syntax is OK! Can you help me find the problem? Note the fields PartNo and ItemDesc is the only text data type on my MS Access database.
2
2792
by: Yasutaka Ito | last post by:
Hi folks! I have a BaseForm class that inherits System.Windows.Forms.Form. It has a property, whose value I need supplied by the class that inherits it. The BaseForm usees the value supplied into this property in its Load event. So, I gave the BaseForm and the property 'abstract' modifier, and put the implementation of the property in the inherited class; say MyForm. However, when I did this, I no longer can open MyForm in the design...
0
1321
by: Jack | last post by:
Hi, I have the following problem. I have a main data entry form which has a link to a detailed data entry form. The value of the link in the main form is the sum total of all the line items in the detailed form. The detailed form has fields to capture the individual line items like contracted service expense, travel expense etc. I am capturing the total of individual line items using session variables so
8
5473
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- Hello, I have a very simple problem but cannot seem to figure it out. I have a very simple php script that sends a test email to myself. When I debug it in PHP designer, it works with no problems, I get the test email. If
1
1381
by: LaughOutLoud | last post by:
Hi. I wonder is it possible to grab everything in a form by calling one javascript function and turns it into array or object? E.g. <form id="form1" name="form1" method="post" action=""> <input name="fname" type="text" id="fname" /> <input name="lname" type="text" id="lname" /> <input name="email" type="text" id="email" /> </form>
4
1449
by: Eric Layman | last post by:
HI, Im on dotnet 1.1 I've generated extra checkboxes, textboxes via client side javascript: eg: var inputElement = document.createElement('input'); inputElement.setAttribute('type', 'radio');...
7
3296
by: vunet.us | last post by:
I cannot append a node from XML into the HTML dom (textarea field) in IE. But I can for the text input html elements! Is anyone aware of this and what is the possible solution? Thanks.
7
2932
by: php_mysql_beginer911 | last post by:
Hi .. hope someone will help i am trying to figure it out why i cannot post string "union select" every time i try to post data which content union and select .. the page doesn't get posted and it shows error page not found on this server i googled and found some people use union and select to hack sites (mysql injection) i guess the server i am using has some kind of filter and if a post string content "union select" ... it simply...
0
8701
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8623
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9185
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9049
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7772
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5879
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4636
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3069
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2015
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.