473,320 Members | 1,857 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.

Another checkbox manipulation question

<i><input type="checkbox" name="chk_Complete" value="TRUE" <%Response.Write
l_IsChecked%>"<%if cbool(l_IsChecked) then Response.Write " checked" Else
Response.Write " unchecked"%>>

The above code shows a checkbox on a asp form where the checkbox value is
stored and retrived from a field in an
Access database.

When the checkbox is unchecked, for some reason, the value of checkbox shows
null value instead of showing False
(This is the sql processing and database update asp page)

I would like to force this value to be false in the event the
(Request.Form("chk_Complete") value is null.

The following is the code to force False value in the above field. However,
the value is stil null. Any
help is appreciated. The variable output and the sql generated for unchecked
and checked cases are also shown.


if CBool(Request.Form("chk_Complete")) = "" Then
Cbool(Request.Form("chk_Complete")) = "False"
end if
l_f_IsChecked = (Request.Form("chk_Complete"))
CASE: CHECKBOX UNCHECKED

START CHECK COMPLETE

THE END
StartCheckBox

EndCheckbox

UPDATE tblGMISExpenditures_Quarter SET
tblGMISExpenditures_Quarter.CurrentOutlay= '$550.00' ,
tblGMISExpenditures_Quarter.LocalShare= '$100.50' ,
tblGMISExpenditures_Quarter.MBCCShare= '449.5' ,
tblGMISExpenditures_Quarter.UnpaidOblig= '$250.00' ,
tblGMISExpenditures_Quarter.LocalShareUnpaidOblig= '$35.35' ,
tblGMISExpenditures_Quarter.ProjectIncome= '$100.00' ,
tblGMISExpenditures_Quarter.ForfeitureIncome= '$200.00' ,
tblGMISExpenditures_Quarter.OtherExpense= '$30.00' ,
tblGMISExpenditures_Quarter.ForfeitureExpense= '$40.00' ,
tblGMISExpenditures_Quarter.InterestReceived= '$20.00' ,
tblGMISExpenditures_Quarter.TotalPeriodOutlay= '4568.39' ,
tblGMISExpenditures_Quarter.Remarks= 'Testing GWIS' ,
tblGMISExpenditures_Quarter.Name= 'Jack Jones' ,
tblGMISExpenditures_Quarter.Title= 'Manager' ,
tblGMISExpenditures_Quarter.AreaCode= '111' ,
tblGMISExpenditures_Quarter.Phone1= '111' ,
tblGMISExpenditures_Quarter.Phone2= '8762' ,
tblGMISExpenditures_Quarter.Date= '1/11/2005' ,
tblGMISExpenditures_Quarter.IsChecked= where
tblGMISExpenditures_Quarter.SubgrantIntID = 4836;

CASE: CHECK BOX CHECKED

START CHECK COMPLETE
TRUE
THE END
StartCheckBox
TRUE
EndCheckbox

UPDATE tblGMISExpenditures_Quarter SET
tblGMISExpenditures_Quarter.CurrentOutlay= '$550.00' ,
tblGMISExpenditures_Quarter.LocalShare= '$100.50' ,
tblGMISExpenditures_Quarter.MBCCShare= '449.5' ,
tblGMISExpenditures_Quarter.UnpaidOblig= '$250.00' ,
tblGMISExpenditures_Quarter.LocalShareUnpaidOblig= '$35.35' ,
tblGMISExpenditures_Quarter.ProjectIncome= '$100.00' ,
tblGMISExpenditures_Quarter.ForfeitureIncome= '$200.00' ,
tblGMISExpenditures_Quarter.OtherExpense= '$30.00' ,
tblGMISExpenditures_Quarter.ForfeitureExpense= '$40.00' ,
tblGMISExpenditures_Quarter.InterestReceived= '$20.00' ,
tblGMISExpenditures_Quarter.TotalPeriodOutlay= '4568.39' ,
tblGMISExpenditures_Quarter.Remarks= 'Testing GWIS' ,
tblGMISExpenditures_Quarter.Name= 'Jack Jones' ,
tblGMISExpenditures_Quarter.Title= 'Manager' ,
tblGMISExpenditures_Quarter.AreaCode= '111' ,
tblGMISExpenditures_Quarter.Phone1= '111' ,
tblGMISExpenditures_Quarter.Phone2= '8762' ,
tblGMISExpenditures_Quarter.Date= '1/11/2005' ,
tblGMISExpenditures_Quarter.IsChecked= TRUE where
tblGMISExpenditures_Quarter.SubgrantIntID = 4836;
Jul 22 '05 #1
3 1962
When the checkbox is unchecked the value is not sent in the form.
Try something like this;

<input type="checkbox" name="chk_Complete" value="TRUE"
<%if cbool(l_IsChecked) then Response.Write " checked" %>>

and

If Trim(Request.Form("chk_Complete")) = "TRUE" Then
l_f_IsChecked = "TRUE"
Else
l_f_IsChecked = "FALSE"
End If

I'd also suggest using boolean values instead of tossing CBool in
everywhere.

<input type="checkbox" name="chk_Complete" value="TRUE"
<%if l_IsChecked then Response.Write " checked" %>>

and

If Trim(Request.Form("chk_Complete")) = "TRUE" Then
l_f_IsChecked = True
Else
l_f_IsChecked = True
End If

--
Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com
"Jack" <Ja**@discussions.microsoft.com> wrote in message
news:9D**********************************@microsof t.com...
<i><input type="checkbox" name="chk_Complete" value="TRUE" <%Response.Write l_IsChecked%>"<%if cbool(l_IsChecked) then Response.Write " checked" Else
Response.Write " unchecked"%>>

The above code shows a checkbox on a asp form where the checkbox value is
stored and retrived from a field in an
Access database.

When the checkbox is unchecked, for some reason, the value of checkbox shows null value instead of showing False
(This is the sql processing and database update asp page)

I would like to force this value to be false in the event the
(Request.Form("chk_Complete") value is null.

The following is the code to force False value in the above field. However, the value is stil null. Any
help is appreciated. The variable output and the sql generated for unchecked and checked cases are also shown.


if CBool(Request.Form("chk_Complete")) = "" Then
Cbool(Request.Form("chk_Complete")) = "False"
end if
l_f_IsChecked = (Request.Form("chk_Complete"))
CASE: CHECKBOX UNCHECKED

START CHECK COMPLETE

THE END
StartCheckBox

EndCheckbox

UPDATE tblGMISExpenditures_Quarter SET
tblGMISExpenditures_Quarter.CurrentOutlay= '$550.00' ,
tblGMISExpenditures_Quarter.LocalShare= '$100.50' ,
tblGMISExpenditures_Quarter.MBCCShare= '449.5' ,
tblGMISExpenditures_Quarter.UnpaidOblig= '$250.00' ,
tblGMISExpenditures_Quarter.LocalShareUnpaidOblig= '$35.35' ,
tblGMISExpenditures_Quarter.ProjectIncome= '$100.00' ,
tblGMISExpenditures_Quarter.ForfeitureIncome= '$200.00' ,
tblGMISExpenditures_Quarter.OtherExpense= '$30.00' ,
tblGMISExpenditures_Quarter.ForfeitureExpense= '$40.00' ,
tblGMISExpenditures_Quarter.InterestReceived= '$20.00' ,
tblGMISExpenditures_Quarter.TotalPeriodOutlay= '4568.39' ,
tblGMISExpenditures_Quarter.Remarks= 'Testing GWIS' ,
tblGMISExpenditures_Quarter.Name= 'Jack Jones' ,
tblGMISExpenditures_Quarter.Title= 'Manager' ,
tblGMISExpenditures_Quarter.AreaCode= '111' ,
tblGMISExpenditures_Quarter.Phone1= '111' ,
tblGMISExpenditures_Quarter.Phone2= '8762' ,
tblGMISExpenditures_Quarter.Date= '1/11/2005' ,
tblGMISExpenditures_Quarter.IsChecked= where
tblGMISExpenditures_Quarter.SubgrantIntID = 4836;

CASE: CHECK BOX CHECKED

START CHECK COMPLETE
TRUE
THE END
StartCheckBox
TRUE
EndCheckbox

UPDATE tblGMISExpenditures_Quarter SET
tblGMISExpenditures_Quarter.CurrentOutlay= '$550.00' ,
tblGMISExpenditures_Quarter.LocalShare= '$100.50' ,
tblGMISExpenditures_Quarter.MBCCShare= '449.5' ,
tblGMISExpenditures_Quarter.UnpaidOblig= '$250.00' ,
tblGMISExpenditures_Quarter.LocalShareUnpaidOblig= '$35.35' ,
tblGMISExpenditures_Quarter.ProjectIncome= '$100.00' ,
tblGMISExpenditures_Quarter.ForfeitureIncome= '$200.00' ,
tblGMISExpenditures_Quarter.OtherExpense= '$30.00' ,
tblGMISExpenditures_Quarter.ForfeitureExpense= '$40.00' ,
tblGMISExpenditures_Quarter.InterestReceived= '$20.00' ,
tblGMISExpenditures_Quarter.TotalPeriodOutlay= '4568.39' ,
tblGMISExpenditures_Quarter.Remarks= 'Testing GWIS' ,
tblGMISExpenditures_Quarter.Name= 'Jack Jones' ,
tblGMISExpenditures_Quarter.Title= 'Manager' ,
tblGMISExpenditures_Quarter.AreaCode= '111' ,
tblGMISExpenditures_Quarter.Phone1= '111' ,
tblGMISExpenditures_Quarter.Phone2= '8762' ,
tblGMISExpenditures_Quarter.Date= '1/11/2005' ,
tblGMISExpenditures_Quarter.IsChecked= TRUE where
tblGMISExpenditures_Quarter.SubgrantIntID = 4836;

Jul 22 '05 #2
I got help from Bob Barrows in an earlier posting about the checkbox and it
solved the problem. Thanks anyways.

"Jack" wrote:
<i><input type="checkbox" name="chk_Complete" value="TRUE" <%Response.Write
l_IsChecked%>"<%if cbool(l_IsChecked) then Response.Write " checked" Else
Response.Write " unchecked"%>>

The above code shows a checkbox on a asp form where the checkbox value is
stored and retrived from a field in an
Access database.

When the checkbox is unchecked, for some reason, the value of checkbox shows
null value instead of showing False
(This is the sql processing and database update asp page)

I would like to force this value to be false in the event the
(Request.Form("chk_Complete") value is null.

The following is the code to force False value in the above field. However,
the value is stil null. Any
help is appreciated. The variable output and the sql generated for unchecked
and checked cases are also shown.


if CBool(Request.Form("chk_Complete")) = "" Then
Cbool(Request.Form("chk_Complete")) = "False"
end if
l_f_IsChecked = (Request.Form("chk_Complete"))
CASE: CHECKBOX UNCHECKED

START CHECK COMPLETE

THE END
StartCheckBox

EndCheckbox

UPDATE tblGMISExpenditures_Quarter SET
tblGMISExpenditures_Quarter.CurrentOutlay= '$550.00' ,
tblGMISExpenditures_Quarter.LocalShare= '$100.50' ,
tblGMISExpenditures_Quarter.MBCCShare= '449.5' ,
tblGMISExpenditures_Quarter.UnpaidOblig= '$250.00' ,
tblGMISExpenditures_Quarter.LocalShareUnpaidOblig= '$35.35' ,
tblGMISExpenditures_Quarter.ProjectIncome= '$100.00' ,
tblGMISExpenditures_Quarter.ForfeitureIncome= '$200.00' ,
tblGMISExpenditures_Quarter.OtherExpense= '$30.00' ,
tblGMISExpenditures_Quarter.ForfeitureExpense= '$40.00' ,
tblGMISExpenditures_Quarter.InterestReceived= '$20.00' ,
tblGMISExpenditures_Quarter.TotalPeriodOutlay= '4568.39' ,
tblGMISExpenditures_Quarter.Remarks= 'Testing GWIS' ,
tblGMISExpenditures_Quarter.Name= 'Jack Jones' ,
tblGMISExpenditures_Quarter.Title= 'Manager' ,
tblGMISExpenditures_Quarter.AreaCode= '111' ,
tblGMISExpenditures_Quarter.Phone1= '111' ,
tblGMISExpenditures_Quarter.Phone2= '8762' ,
tblGMISExpenditures_Quarter.Date= '1/11/2005' ,
tblGMISExpenditures_Quarter.IsChecked= where
tblGMISExpenditures_Quarter.SubgrantIntID = 4836;

CASE: CHECK BOX CHECKED

START CHECK COMPLETE
TRUE
THE END
StartCheckBox
TRUE
EndCheckbox

UPDATE tblGMISExpenditures_Quarter SET
tblGMISExpenditures_Quarter.CurrentOutlay= '$550.00' ,
tblGMISExpenditures_Quarter.LocalShare= '$100.50' ,
tblGMISExpenditures_Quarter.MBCCShare= '449.5' ,
tblGMISExpenditures_Quarter.UnpaidOblig= '$250.00' ,
tblGMISExpenditures_Quarter.LocalShareUnpaidOblig= '$35.35' ,
tblGMISExpenditures_Quarter.ProjectIncome= '$100.00' ,
tblGMISExpenditures_Quarter.ForfeitureIncome= '$200.00' ,
tblGMISExpenditures_Quarter.OtherExpense= '$30.00' ,
tblGMISExpenditures_Quarter.ForfeitureExpense= '$40.00' ,
tblGMISExpenditures_Quarter.InterestReceived= '$20.00' ,
tblGMISExpenditures_Quarter.TotalPeriodOutlay= '4568.39' ,
tblGMISExpenditures_Quarter.Remarks= 'Testing GWIS' ,
tblGMISExpenditures_Quarter.Name= 'Jack Jones' ,
tblGMISExpenditures_Quarter.Title= 'Manager' ,
tblGMISExpenditures_Quarter.AreaCode= '111' ,
tblGMISExpenditures_Quarter.Phone1= '111' ,
tblGMISExpenditures_Quarter.Phone2= '8762' ,
tblGMISExpenditures_Quarter.Date= '1/11/2005' ,
tblGMISExpenditures_Quarter.IsChecked= TRUE where
tblGMISExpenditures_Quarter.SubgrantIntID = 4836;

Jul 22 '05 #3
Thanks Mark for your help. I have already got it solved. However, I am going
to try it the way you suggested. Regards.

"Mark Schupp" wrote:
When the checkbox is unchecked the value is not sent in the form.
Try something like this;

<input type="checkbox" name="chk_Complete" value="TRUE"
<%if cbool(l_IsChecked) then Response.Write " checked" %>>

and

If Trim(Request.Form("chk_Complete")) = "TRUE" Then
l_f_IsChecked = "TRUE"
Else
l_f_IsChecked = "FALSE"
End If

I'd also suggest using boolean values instead of tossing CBool in
everywhere.

<input type="checkbox" name="chk_Complete" value="TRUE"
<%if l_IsChecked then Response.Write " checked" %>>

and

If Trim(Request.Form("chk_Complete")) = "TRUE" Then
l_f_IsChecked = True
Else
l_f_IsChecked = True
End If

--
Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com
"Jack" <Ja**@discussions.microsoft.com> wrote in message
news:9D**********************************@microsof t.com...
<i><input type="checkbox" name="chk_Complete" value="TRUE"

<%Response.Write
l_IsChecked%>"<%if cbool(l_IsChecked) then Response.Write " checked" Else
Response.Write " unchecked"%>>

The above code shows a checkbox on a asp form where the checkbox value is
stored and retrived from a field in an
Access database.

When the checkbox is unchecked, for some reason, the value of checkbox

shows
null value instead of showing False
(This is the sql processing and database update asp page)

I would like to force this value to be false in the event the
(Request.Form("chk_Complete") value is null.

The following is the code to force False value in the above field.

However,
the value is stil null. Any
help is appreciated. The variable output and the sql generated for

unchecked
and checked cases are also shown.


if CBool(Request.Form("chk_Complete")) = "" Then
Cbool(Request.Form("chk_Complete")) = "False"
end if
l_f_IsChecked = (Request.Form("chk_Complete"))
CASE: CHECKBOX UNCHECKED

START CHECK COMPLETE

THE END
StartCheckBox

EndCheckbox

UPDATE tblGMISExpenditures_Quarter SET
tblGMISExpenditures_Quarter.CurrentOutlay= '$550.00' ,
tblGMISExpenditures_Quarter.LocalShare= '$100.50' ,
tblGMISExpenditures_Quarter.MBCCShare= '449.5' ,
tblGMISExpenditures_Quarter.UnpaidOblig= '$250.00' ,
tblGMISExpenditures_Quarter.LocalShareUnpaidOblig= '$35.35' ,
tblGMISExpenditures_Quarter.ProjectIncome= '$100.00' ,
tblGMISExpenditures_Quarter.ForfeitureIncome= '$200.00' ,
tblGMISExpenditures_Quarter.OtherExpense= '$30.00' ,
tblGMISExpenditures_Quarter.ForfeitureExpense= '$40.00' ,
tblGMISExpenditures_Quarter.InterestReceived= '$20.00' ,
tblGMISExpenditures_Quarter.TotalPeriodOutlay= '4568.39' ,
tblGMISExpenditures_Quarter.Remarks= 'Testing GWIS' ,
tblGMISExpenditures_Quarter.Name= 'Jack Jones' ,
tblGMISExpenditures_Quarter.Title= 'Manager' ,
tblGMISExpenditures_Quarter.AreaCode= '111' ,
tblGMISExpenditures_Quarter.Phone1= '111' ,
tblGMISExpenditures_Quarter.Phone2= '8762' ,
tblGMISExpenditures_Quarter.Date= '1/11/2005' ,
tblGMISExpenditures_Quarter.IsChecked= where
tblGMISExpenditures_Quarter.SubgrantIntID = 4836;

CASE: CHECK BOX CHECKED

START CHECK COMPLETE
TRUE
THE END
StartCheckBox
TRUE
EndCheckbox

UPDATE tblGMISExpenditures_Quarter SET
tblGMISExpenditures_Quarter.CurrentOutlay= '$550.00' ,
tblGMISExpenditures_Quarter.LocalShare= '$100.50' ,
tblGMISExpenditures_Quarter.MBCCShare= '449.5' ,
tblGMISExpenditures_Quarter.UnpaidOblig= '$250.00' ,
tblGMISExpenditures_Quarter.LocalShareUnpaidOblig= '$35.35' ,
tblGMISExpenditures_Quarter.ProjectIncome= '$100.00' ,
tblGMISExpenditures_Quarter.ForfeitureIncome= '$200.00' ,
tblGMISExpenditures_Quarter.OtherExpense= '$30.00' ,
tblGMISExpenditures_Quarter.ForfeitureExpense= '$40.00' ,
tblGMISExpenditures_Quarter.InterestReceived= '$20.00' ,
tblGMISExpenditures_Quarter.TotalPeriodOutlay= '4568.39' ,
tblGMISExpenditures_Quarter.Remarks= 'Testing GWIS' ,
tblGMISExpenditures_Quarter.Name= 'Jack Jones' ,
tblGMISExpenditures_Quarter.Title= 'Manager' ,
tblGMISExpenditures_Quarter.AreaCode= '111' ,
tblGMISExpenditures_Quarter.Phone1= '111' ,
tblGMISExpenditures_Quarter.Phone2= '8762' ,
tblGMISExpenditures_Quarter.Date= '1/11/2005' ,
tblGMISExpenditures_Quarter.IsChecked= TRUE where
tblGMISExpenditures_Quarter.SubgrantIntID = 4836;


Jul 22 '05 #4

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

Similar topics

4
by: Jay | last post by:
Hi everybody ! I am currently writing a webpage that displays a list of records ( each record has a checkbox associated with it) to allow users to select any record they want to delete (much...
0
by: claudel | last post by:
Hi I have a newb PHP/Javascript question regarding checkbox processing I'm not sure which area it falls into so I crossposted to comp.lang.php and comp.lang.javascript. I'm trying to...
7
by: The Corinthian | last post by:
I am quite new to ASP scripting and seem to be haveing no success with checkboxes at all. I have a sql database with bit datatypes and I am trying to create a asp webform which will display and...
2
by: Fred | last post by:
Hi, I defined a form consisting of checkboxes like: <form> <input type="checkbox" name=ck id=ck onclick="check(this.form)" <input type="checkbox" name=ck id=ck onclick="check(this.form)" ........
0
by: Patrick Olurotimi Ige | last post by:
I want to insert checkbox Y/N or 1/0 into a SQL table. I know i can do that using a bit field or Char field. My Question is i have Datalist that lists products and i want to put this checkBoxes...
34
by: clinttoris | last post by:
Hello Experts, I have been told to post this in the Javascript forum as I want to do this client side just before my form gets submitted. Once the user clicks the submit button a javascript...
1
by: arun.hallan | last post by:
Hi, I have two columns in a datagrid that are filled with checkboxes. I want one checkbox in a row to be checked when the corresponding checkbox is checked. I've added an OnCheckedChanged...
3
by: delram | last post by:
I'm trying to get user selections (using checkboxes) on one JSP page(A.jsp) and pass them on to another page. So I have one page with a list of dynamically populated items like this 1 2 ...
3
by: chiku1523 | last post by:
Hi, Please find the following code. In function setAnswers, I am looping with each question. I have inner loop, which is looping for each answers of the questions. If any of the answer for question...
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
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
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...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
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: 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.