473,574 Members | 2,233 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 1499
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
7968
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...
5
1628
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
2780
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...
0
1318
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...
8
5460
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...
1
1375
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
1444
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
3289
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
2913
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...
0
7831
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...
0
8262
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...
0
6497
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...
1
5641
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5331
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...
0
3768
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3785
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1364
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1092
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...

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.