473,320 Members | 1,744 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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 = "contractedserviceexpense_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 = "personnelexpense_0"
style = "FONT-SIZE: 10">
</TD>
</TR>
</table>
PROCESSING CODE:

l_ENO = Request.Form("ID_0")

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

Response.Write l_Date & "<br>"


l_ContracedServiceExpense =
Request.Form("contractedserviceexpense_0")

Response.Write l_contractedserviceexpense
l_TravelExpense = Request.Form("travelexpense_0")

Response.Write l_travelexpense & "<br>"
l_PersonnelExpense = Request.Form("personnelexpense_0")

Response.Write l_personnel & "<br>"

'Create the UPDATE SQL STATEMENT

sql = " INSERT INTO tblExpense (ENO, Date,
ContractedServiceExpense, "
sql = sql & "TravelExpense, PersonnelExpense)"
sql = sql & " VALUES('" & l_ENO & "' , '" & l_Date & "', '" &
l_contractedserviceexpense & "', '" & l_travelexpense & "', '" &
personnelexpense & "')"
Response.Write sql & "<BR>"
OUTPUT FROM THE PROCESSED ASP PAGE

1
03/29/2005
5


INSERT INTO tblExpense (ENO, Date, ContractedServiceExpense, TravelExpense,
PersonnelExpense) VALUES('1' , '03/29/2005', '', '5', '')
Jul 22 '05 #1
2 1489
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_ContracedServiceExpense = Request.Form("contractedserviceexpense_0")
^^^
Response.Write l_contractedserviceexpense
^^^

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

Ray at work

"Jack" <Ja**@discussions.microsoft.com> wrote in message
news:E7**********************************@microsof t.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 = "contractedserviceexpense_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 = "personnelexpense_0"
style = "FONT-SIZE: 10">
</TD>
</TR>
</table>
PROCESSING CODE:

l_ENO = Request.Form("ID_0")

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

Response.Write l_Date & "<br>"


l_ContracedServiceExpense =
Request.Form("contractedserviceexpense_0")

Response.Write l_contractedserviceexpense
l_TravelExpense = Request.Form("travelexpense_0")

Response.Write l_travelexpense & "<br>"
l_PersonnelExpense = Request.Form("personnelexpense_0")

Response.Write l_personnel & "<br>"

'Create the UPDATE SQL STATEMENT

sql = " INSERT INTO tblExpense (ENO, Date,
ContractedServiceExpense, "
sql = sql & "TravelExpense, PersonnelExpense)"
sql = sql & " VALUES('" & l_ENO & "' , '" & l_Date & "', '" &
l_contractedserviceexpense & "', '" & l_travelexpense & "', '" &
personnelexpense & "')"
Response.Write sql & "<BR>"
OUTPUT FROM THE PROCESSED ASP PAGE

1
03/29/2005
5


INSERT INTO tblExpense (ENO, Date, ContractedServiceExpense, TravelExpense, PersonnelExpense) 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_ContracedServiceExpense = Request.Form("contractedserviceexpense_0")
^^^
Response.Write l_contractedserviceexpense
^^^

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

Ray at work

"Jack" <Ja**@discussions.microsoft.com> wrote in message
news:E7**********************************@microsof t.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 = "contractedserviceexpense_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 = "personnelexpense_0"
style = "FONT-SIZE: 10">
</TD>
</TR>
</table>
PROCESSING CODE:

l_ENO = Request.Form("ID_0")

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

Response.Write l_Date & "<br>"


l_ContracedServiceExpense =
Request.Form("contractedserviceexpense_0")

Response.Write l_contractedserviceexpense
l_TravelExpense = Request.Form("travelexpense_0")

Response.Write l_travelexpense & "<br>"
l_PersonnelExpense = Request.Form("personnelexpense_0")

Response.Write l_personnel & "<br>"

'Create the UPDATE SQL STATEMENT

sql = " INSERT INTO tblExpense (ENO, Date,
ContractedServiceExpense, "
sql = sql & "TravelExpense, PersonnelExpense)"
sql = sql & " VALUES('" & l_ENO & "' , '" & l_Date & "', '" &
l_contractedserviceexpense & "', '" & l_travelexpense & "', '" &
personnelexpense & "')"
Response.Write sql & "<BR>"
OUTPUT FROM THE PROCESSED ASP PAGE

1
03/29/2005
5


INSERT INTO tblExpense (ENO, Date, ContractedServiceExpense,

TravelExpense,
PersonnelExpense) 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
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...
5
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...
2
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...
0
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...
8
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 -------------------------------------------------------------------------------- ...
1
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="">...
4
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',...
7
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
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.