By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,175 Members | 1,710 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,175 IT Pros & Developers. It's quick & easy.

Still not resolved. Need expert help

P: n/a
I have a asp form where among others there are few text boxes and one check
box. The checkbox is
to indicate whether the entry is final. The checkbox is attahced to a field
in table of type yes/no.
After saving the documents,the form is refreshed. At this point, if the
checkbox has been saved with checked,
it shows unchecked, if it has been saved unchecked it shows unchecked.

Here, if the checkbox shows checked, I want to disable (or lock) all the
text boxes and the checkbox itself
which will prevent further entry.

Can this be done with asp? Any suggestion/help is highly appeciated.
Previous postings did not help
to get this resolved. Regards.
Jul 22 '05 #1
Share this Question
Share on Google+
11 Replies


P: n/a
You will have to get the value of the checkbox when the page loads. I would
use a simple string value to hold a " disabled " or " " text string. Then in
ALL of your controls do a <input..... <%= YourValue %> ...>
--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Jack" <Ja**@discussions.microsoft.com> wrote in message
news:24**********************************@microsof t.com...
I have a asp form where among others there are few text boxes and one check
box. The checkbox is
to indicate whether the entry is final. The checkbox is attahced to a
field
in table of type yes/no.
After saving the documents,the form is refreshed. At this point, if the
checkbox has been saved with checked,
it shows unchecked, if it has been saved unchecked it shows unchecked.

Here, if the checkbox shows checked, I want to disable (or lock) all the
text boxes and the checkbox itself
which will prevent further entry.

Can this be done with asp? Any suggestion/help is highly appeciated.
Previous postings did not help
to get this resolved. Regards.

Jul 22 '05 #2

P: n/a
Thanks for your insight Curt, I appreciate it. Here is the code of the
checkbox:
<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"%>>

while one of the textbox in the asp page is coded as:
<input type="text" name="txt_CurrentOutlay" size="13"
value="<%Response.Write FormatCurrency(l_cu_CurrentOutlay,2)%>"
style="font-family: Times New Roman; font-size: 12pt"></font></td>
Now, are you suggesting to use the value of l_IsChecked to be utilized in
the input tag of the text boxes? Need a little clarification here. Regards

"Curt_C [MVP]" wrote:
You will have to get the value of the checkbox when the page loads. I would
use a simple string value to hold a " disabled " or " " text string. Then in
ALL of your controls do a <input..... <%= YourValue %> ...>
--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Jack" <Ja**@discussions.microsoft.com> wrote in message
news:24**********************************@microsof t.com...
I have a asp form where among others there are few text boxes and one check
box. The checkbox is
to indicate whether the entry is final. The checkbox is attahced to a
field
in table of type yes/no.
After saving the documents,the form is refreshed. At this point, if the
checkbox has been saved with checked,
it shows unchecked, if it has been saved unchecked it shows unchecked.

Here, if the checkbox shows checked, I want to disable (or lock) all the
text boxes and the checkbox itself
which will prevent further entry.

Can this be done with asp? Any suggestion/help is highly appeciated.
Previous postings did not help
to get this resolved. Regards.


Jul 22 '05 #3

P: n/a
correct...
<%
if cbool(l_IsChecked)
isDisabled = " disabled "
else
isDisabled = " "

<input type="text" name="txt_CurrentOutlay" <%= isDisabled %> ......
--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Jack" <Ja**@discussions.microsoft.com> wrote in message
news:06**********************************@microsof t.com...
Thanks for your insight Curt, I appreciate it. Here is the code of the
checkbox:
<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"%>>

while one of the textbox in the asp page is coded as:
<input type="text" name="txt_CurrentOutlay" size="13"
value="<%Response.Write FormatCurrency(l_cu_CurrentOutlay,2)%>"
style="font-family: Times New Roman; font-size: 12pt"></font></td>
Now, are you suggesting to use the value of l_IsChecked to be utilized in
the input tag of the text boxes? Need a little clarification here. Regards

"Curt_C [MVP]" wrote:
You will have to get the value of the checkbox when the page loads. I
would
use a simple string value to hold a " disabled " or " " text string. Then
in
ALL of your controls do a <input..... <%= YourValue %> ...>
--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Jack" <Ja**@discussions.microsoft.com> wrote in message
news:24**********************************@microsof t.com...
>I have a asp form where among others there are few text boxes and one
>check
> box. The checkbox is
> to indicate whether the entry is final. The checkbox is attahced to a
> field
> in table of type yes/no.
> After saving the documents,the form is refreshed. At this point, if the
> checkbox has been saved with checked,
> it shows unchecked, if it has been saved unchecked it shows unchecked.
>
> Here, if the checkbox shows checked, I want to disable (or lock) all
> the
> text boxes and the checkbox itself
> which will prevent further entry.
>
> Can this be done with asp? Any suggestion/help is highly appeciated.
> Previous postings did not help
> to get this resolved. Regards.


Jul 22 '05 #4

P: n/a
obviously you need to clean up the code, what I wrote was only suggestion
quality :}

--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:e$****************@TK2MSFTNGP15.phx.gbl...
correct...
<%
if cbool(l_IsChecked)
isDisabled = " disabled "
else
isDisabled = " "

<input type="text" name="txt_CurrentOutlay" <%= isDisabled %> ......
--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Jack" <Ja**@discussions.microsoft.com> wrote in message
news:06**********************************@microsof t.com...
Thanks for your insight Curt, I appreciate it. Here is the code of the
checkbox:
<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"%>>

while one of the textbox in the asp page is coded as:
<input type="text" name="txt_CurrentOutlay" size="13"
value="<%Response.Write FormatCurrency(l_cu_CurrentOutlay,2)%>"
style="font-family: Times New Roman; font-size: 12pt"></font></td>
Now, are you suggesting to use the value of l_IsChecked to be utilized in
the input tag of the text boxes? Need a little clarification here.
Regards

"Curt_C [MVP]" wrote:
You will have to get the value of the checkbox when the page loads. I
would
use a simple string value to hold a " disabled " or " " text string.
Then in
ALL of your controls do a <input..... <%= YourValue %> ...>
--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Jack" <Ja**@discussions.microsoft.com> wrote in message
news:24**********************************@microsof t.com...
>I have a asp form where among others there are few text boxes and one
>check
> box. The checkbox is
> to indicate whether the entry is final. The checkbox is attahced to a
> field
> in table of type yes/no.
> After saving the documents,the form is refreshed. At this point, if
> the
> checkbox has been saved with checked,
> it shows unchecked, if it has been saved unchecked it shows unchecked.
>
> Here, if the checkbox shows checked, I want to disable (or lock) all
> the
> text boxes and the checkbox itself
> which will prevent further entry.
>
> Can this be done with asp? Any suggestion/help is highly appeciated.
> Previous postings did not help
> to get this resolved. Regards.


Jul 22 '05 #5

P: n/a
You just had wonderful advise, Curt. Thanks a ton. Instead of disabled, I had
to change the properties to readonly. With the texts and the checkbox being
disabled, the values are not been passed to the sql processing and database
saving asp page. However, with readonly attribute, this problem does not
arise.

Only one problem still exists. That is, with the checkbox, the readonly
property did not work. The disbled property cannot be applied due to the
reasons explained above. Do you have any idea, how to make the checkbox
'useless' i.e. users will not be able to click and uncheck the checkbox now.
I am yet to come up with an idea.
Any thoughts. Regards.

"Curt_C [MVP]" wrote:
correct...
<%
if cbool(l_IsChecked)
isDisabled = " disabled "
else
isDisabled = " "

<input type="text" name="txt_CurrentOutlay" <%= isDisabled %> ......
--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Jack" <Ja**@discussions.microsoft.com> wrote in message
news:06**********************************@microsof t.com...
Thanks for your insight Curt, I appreciate it. Here is the code of the
checkbox:
<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"%>>

while one of the textbox in the asp page is coded as:
<input type="text" name="txt_CurrentOutlay" size="13"
value="<%Response.Write FormatCurrency(l_cu_CurrentOutlay,2)%>"
style="font-family: Times New Roman; font-size: 12pt"></font></td>
Now, are you suggesting to use the value of l_IsChecked to be utilized in
the input tag of the text boxes? Need a little clarification here. Regards

"Curt_C [MVP]" wrote:
You will have to get the value of the checkbox when the page loads. I
would
use a simple string value to hold a " disabled " or " " text string. Then
in
ALL of your controls do a <input..... <%= YourValue %> ...>
--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Jack" <Ja**@discussions.microsoft.com> wrote in message
news:24**********************************@microsof t.com...
>I have a asp form where among others there are few text boxes and one
>check
> box. The checkbox is
> to indicate whether the entry is final. The checkbox is attahced to a
> field
> in table of type yes/no.
> After saving the documents,the form is refreshed. At this point, if the
> checkbox has been saved with checked,
> it shows unchecked, if it has been saved unchecked it shows unchecked.
>
> Here, if the checkbox shows checked, I want to disable (or lock) all
> the
> text boxes and the checkbox itself
> which will prevent further entry.
>
> Can this be done with asp? Any suggestion/help is highly appeciated.
> Previous postings did not help
> to get this resolved. Regards.


Jul 22 '05 #6

P: n/a
we had a similar issue with checkboxes. What we did to work around it was
add an onClick() so that if it was checked and someone clicked it, it
automatically, re-checked itself.

--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Jack" <Ja**@discussions.microsoft.com> wrote in message
news:50**********************************@microsof t.com...
You just had wonderful advise, Curt. Thanks a ton. Instead of disabled, I
had
to change the properties to readonly. With the texts and the checkbox
being
disabled, the values are not been passed to the sql processing and
database
saving asp page. However, with readonly attribute, this problem does not
arise.

Only one problem still exists. That is, with the checkbox, the readonly
property did not work. The disbled property cannot be applied due to the
reasons explained above. Do you have any idea, how to make the checkbox
'useless' i.e. users will not be able to click and uncheck the checkbox
now.
I am yet to come up with an idea.
Any thoughts. Regards.

"Curt_C [MVP]" wrote:
correct...
<%
if cbool(l_IsChecked)
isDisabled = " disabled "
else
isDisabled = " "

<input type="text" name="txt_CurrentOutlay" <%= isDisabled %> ......
--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Jack" <Ja**@discussions.microsoft.com> wrote in message
news:06**********************************@microsof t.com...
> Thanks for your insight Curt, I appreciate it. Here is the code of the
> checkbox:
> <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"%>>
>
> while one of the textbox in the asp page is coded as:
> <input type="text" name="txt_CurrentOutlay" size="13"
> value="<%Response.Write FormatCurrency(l_cu_CurrentOutlay,2)%>"
> style="font-family: Times New Roman; font-size: 12pt"></font></td>
> Now, are you suggesting to use the value of l_IsChecked to be utilized
> in
> the input tag of the text boxes? Need a little clarification here.
> Regards
>
>
>
>
>
> "Curt_C [MVP]" wrote:
>
>> You will have to get the value of the checkbox when the page loads. I
>> would
>> use a simple string value to hold a " disabled " or " " text string.
>> Then
>> in
>> ALL of your controls do a <input..... <%= YourValue %> ...>
>>
>>
>> --
>> Curt Christianson
>> Site & Scripts: http://www.Darkfalz.com
>> Blog: http://blog.Darkfalz.com
>>
>>
>> "Jack" <Ja**@discussions.microsoft.com> wrote in message
>> news:24**********************************@microsof t.com...
>> >I have a asp form where among others there are few text boxes and one
>> >check
>> > box. The checkbox is
>> > to indicate whether the entry is final. The checkbox is attahced to
>> > a
>> > field
>> > in table of type yes/no.
>> > After saving the documents,the form is refreshed. At this point, if
>> > the
>> > checkbox has been saved with checked,
>> > it shows unchecked, if it has been saved unchecked it shows
>> > unchecked.
>> >
>> > Here, if the checkbox shows checked, I want to disable (or lock) all
>> > the
>> > text boxes and the checkbox itself
>> > which will prevent further entry.
>> >
>> > Can this be done with asp? Any suggestion/help is highly appeciated.
>> > Previous postings did not help
>> > to get this resolved. Regards.
>>
>>
>>


Jul 22 '05 #7

P: n/a
I have no idea yet how to handle the onclick stuff. I am consulting the web
for some help. Could you shed some light with the code, if you recall.
Regards. Again, I appreciate all your generous help.

"Curt_C [MVP]" wrote:
we had a similar issue with checkboxes. What we did to work around it was
add an onClick() so that if it was checked and someone clicked it, it
automatically, re-checked itself.

--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Jack" <Ja**@discussions.microsoft.com> wrote in message
news:50**********************************@microsof t.com...
You just had wonderful advise, Curt. Thanks a ton. Instead of disabled, I
had
to change the properties to readonly. With the texts and the checkbox
being
disabled, the values are not been passed to the sql processing and
database
saving asp page. However, with readonly attribute, this problem does not
arise.

Only one problem still exists. That is, with the checkbox, the readonly
property did not work. The disbled property cannot be applied due to the
reasons explained above. Do you have any idea, how to make the checkbox
'useless' i.e. users will not be able to click and uncheck the checkbox
now.
I am yet to come up with an idea.
Any thoughts. Regards.

"Curt_C [MVP]" wrote:
correct...
<%
if cbool(l_IsChecked)
isDisabled = " disabled "
else
isDisabled = " "

<input type="text" name="txt_CurrentOutlay" <%= isDisabled %> ......
--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Jack" <Ja**@discussions.microsoft.com> wrote in message
news:06**********************************@microsof t.com...
> Thanks for your insight Curt, I appreciate it. Here is the code of the
> checkbox:
> <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"%>>
>
> while one of the textbox in the asp page is coded as:
> <input type="text" name="txt_CurrentOutlay" size="13"
> value="<%Response.Write FormatCurrency(l_cu_CurrentOutlay,2)%>"
> style="font-family: Times New Roman; font-size: 12pt"></font></td>
> Now, are you suggesting to use the value of l_IsChecked to be utilized
> in
> the input tag of the text boxes? Need a little clarification here.
> Regards
>
>
>
>
>
> "Curt_C [MVP]" wrote:
>
>> You will have to get the value of the checkbox when the page loads. I
>> would
>> use a simple string value to hold a " disabled " or " " text string.
>> Then
>> in
>> ALL of your controls do a <input..... <%= YourValue %> ...>
>>
>>
>> --
>> Curt Christianson
>> Site & Scripts: http://www.Darkfalz.com
>> Blog: http://blog.Darkfalz.com
>>
>>
>> "Jack" <Ja**@discussions.microsoft.com> wrote in message
>> news:24**********************************@microsof t.com...
>> >I have a asp form where among others there are few text boxes and one
>> >check
>> > box. The checkbox is
>> > to indicate whether the entry is final. The checkbox is attahced to
>> > a
>> > field
>> > in table of type yes/no.
>> > After saving the documents,the form is refreshed. At this point, if
>> > the
>> > checkbox has been saved with checked,
>> > it shows unchecked, if it has been saved unchecked it shows
>> > unchecked.
>> >
>> > Here, if the checkbox shows checked, I want to disable (or lock) all
>> > the
>> > text boxes and the checkbox itself
>> > which will prevent further entry.
>> >
>> > Can this be done with asp? Any suggestion/help is highly appeciated.
>> > Previous postings did not help
>> > to get this resolved. Regards.
>>
>>
>>


Jul 22 '05 #8

P: n/a
Gazing into my crystal ball I observed "=?Utf-8?B?SmFjaw==?="
<Ja**@discussions.microsoft.com> writing in
news:50**********************************@microsof t.com:
You just had wonderful advise, Curt. Thanks a ton. Instead of disabled,
I had to change the properties to readonly. With the texts and the
checkbox being disabled, the values are not been passed to the sql
processing and database saving asp page. However, with readonly
attribute, this problem does not arise.

Only one problem still exists. That is, with the checkbox, the readonly
property did not work. The disbled property cannot be applied due to
the reasons explained above. Do you have any idea, how to make the
checkbox 'useless' i.e. users will not be able to click and uncheck the
checkbox now. I am yet to come up with an idea.
Any thoughts. Regards.
If I were you, I would pass the value in a hidden input, and maybe just
show plain text to let the user know they checked (or did not check)
before. Or you could use the disabled attribute and some CSS to make it
not look disabled (not sure on that one, check with a CSS group to see if
that's possible).


"Curt_C [MVP]" wrote:
correct...
<%
if cbool(l_IsChecked)
isDisabled = " disabled " else
isDisabled = " "

<input type="text" name="txt_CurrentOutlay" <%= isDisabled %> ......
--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Jack" <Ja**@discussions.microsoft.com> wrote in message
news:06**********************************@microsof t.com...
> Thanks for your insight Curt, I appreciate it. Here is the code of
> the checkbox: <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"%>>
>
> while one of the textbox in the asp page is coded as:
> <input type="text" name="txt_CurrentOutlay" size="13"
> value="<%Response.Write FormatCurrency(l_cu_CurrentOutlay,2)%>"
> style="font-family: Times New Roman; font-size: 12pt"></font></td>
> Now, are you suggesting to use the value of l_IsChecked to be
> utilized in the input tag of the text boxes? Need a little
> clarification here. Regards
>
>
>
>
>
> "Curt_C [MVP]" wrote:
>
>> You will have to get the value of the checkbox when the page loads.
>> I would use a simple string value to hold a " disabled " or " "
>> text string. Then in ALL of your controls do a <input..... <%=
>> YourValue %> ...>
>>
>>
>> --
>> Curt Christianson
>> Site & Scripts: http://www.Darkfalz.com
>> Blog: http://blog.Darkfalz.com
>>
>>
>> "Jack" <Ja**@discussions.microsoft.com> wrote in message
>> news:24**********************************@microsof t.com...
>> >I have a asp form where among others there are few text boxes and
>> >one check
>> > box. The checkbox is
>> > to indicate whether the entry is final. The checkbox is attahced
>> > to a field in table of type yes/no.
>> > After saving the documents,the form is refreshed. At this point,
>> > if the checkbox has been saved with checked, it shows unchecked,
>> > if it has been saved unchecked it shows unchecked.
>> >
>> > Here, if the checkbox shows checked, I want to disable (or lock)
>> > all the text boxes and the checkbox itself
>> > which will prevent further entry.
>> >
>> > Can this be done with asp? Any suggestion/help is highly
>> > appeciated. Previous postings did not help to get this resolved.
>> > Regards.
>>
>>
>>



--
Adrienne Boswell
http://www.cavalcade-of-coding.info
Please respond to the group so others can share
Jul 22 '05 #9

P: n/a
I wish I remember where this came from but put this in the head of the page
<SCRIPT LANGUAGE="JavaScript" >
function dont_touch(form) {
if (form.checked) {
form.checked = false
} else {
form.checked = true
}
}
</SCRIPT>

Then put this inside the checkbox tags onClick='dont_touch(this)'

It's javascript not asp but sounds like what you want.

Mike

"Jack" wrote:
I have no idea yet how to handle the onclick stuff. I am consulting the web
for some help. Could you shed some light with the code, if you recall.
Regards. Again, I appreciate all your generous help.

"Curt_C [MVP]" wrote:
we had a similar issue with checkboxes. What we did to work around it was
add an onClick() so that if it was checked and someone clicked it, it
automatically, re-checked itself.

--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Jack" <Ja**@discussions.microsoft.com> wrote in message
news:50**********************************@microsof t.com...
You just had wonderful advise, Curt. Thanks a ton. Instead of disabled, I
had
to change the properties to readonly. With the texts and the checkbox
being
disabled, the values are not been passed to the sql processing and
database
saving asp page. However, with readonly attribute, this problem does not
arise.

Only one problem still exists. That is, with the checkbox, the readonly
property did not work. The disbled property cannot be applied due to the
reasons explained above. Do you have any idea, how to make the checkbox
'useless' i.e. users will not be able to click and uncheck the checkbox
now.
I am yet to come up with an idea.
Any thoughts. Regards.

"Curt_C [MVP]" wrote:

> correct...
> <%
> if cbool(l_IsChecked)
> isDisabled = " disabled "
> else
> isDisabled = " "
>
> <input type="text" name="txt_CurrentOutlay" <%= isDisabled %> ......
>
>
> --
> Curt Christianson
> Site & Scripts: http://www.Darkfalz.com
> Blog: http://blog.Darkfalz.com
>
>
> "Jack" <Ja**@discussions.microsoft.com> wrote in message
> news:06**********************************@microsof t.com...
> > Thanks for your insight Curt, I appreciate it. Here is the code of the
> > checkbox:
> > <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"%>>
> >
> > while one of the textbox in the asp page is coded as:
> > <input type="text" name="txt_CurrentOutlay" size="13"
> > value="<%Response.Write FormatCurrency(l_cu_CurrentOutlay,2)%>"
> > style="font-family: Times New Roman; font-size: 12pt"></font></td>
> > Now, are you suggesting to use the value of l_IsChecked to be utilized
> > in
> > the input tag of the text boxes? Need a little clarification here.
> > Regards
> >
> >
> >
> >
> >
> > "Curt_C [MVP]" wrote:
> >
> >> You will have to get the value of the checkbox when the page loads. I
> >> would
> >> use a simple string value to hold a " disabled " or " " text string.
> >> Then
> >> in
> >> ALL of your controls do a <input..... <%= YourValue %> ...>
> >>
> >>
> >> --
> >> Curt Christianson
> >> Site & Scripts: http://www.Darkfalz.com
> >> Blog: http://blog.Darkfalz.com
> >>
> >>
> >> "Jack" <Ja**@discussions.microsoft.com> wrote in message
> >> news:24**********************************@microsof t.com...
> >> >I have a asp form where among others there are few text boxes and one
> >> >check
> >> > box. The checkbox is
> >> > to indicate whether the entry is final. The checkbox is attahced to
> >> > a
> >> > field
> >> > in table of type yes/no.
> >> > After saving the documents,the form is refreshed. At this point, if
> >> > the
> >> > checkbox has been saved with checked,
> >> > it shows unchecked, if it has been saved unchecked it shows
> >> > unchecked.
> >> >
> >> > Here, if the checkbox shows checked, I want to disable (or lock) all
> >> > the
> >> > text boxes and the checkbox itself
> >> > which will prevent further entry.
> >> >
> >> > Can this be done with asp? Any suggestion/help is highly appeciated.
> >> > Previous postings did not help
> >> > to get this resolved. Regards.
> >>
> >>
> >>
>
>
>


Jul 22 '05 #10

P: n/a
Gazing into my crystal ball I observed =?Utf-8?B?TWlrZSBE?=
<Mi***@discussions.microsoft.com> writing in
news:CD**********************************@microsof t.com:
I wish I remember where this came from but put this in the head of the
page
<SCRIPT LANGUAGE="JavaScript" >
function dont_touch(form) {
if (form.checked) {
form.checked = false
} else {
form.checked = true
}
}
</SCRIPT>

Then put this inside the checkbox tags onClick='dont_touch(this)'

It's javascript not asp but sounds like what you want.

Mike

And with that, unless you know for certain that javascript is available on
the client, you need to validate server side.

"Jack" wrote:
I have no idea yet how to handle the onclick stuff. I am consulting
the web for some help. Could you shed some light with the code, if you
recall. Regards. Again, I appreciate all your generous help.

"Curt_C [MVP]" wrote:
> we had a similar issue with checkboxes. What we did to work around
> it was add an onClick() so that if it was checked and someone
> clicked it, it automatically, re-checked itself.
>
> --
> Curt Christianson
> Site & Scripts: http://www.Darkfalz.com
> Blog: http://blog.Darkfalz.com
>
>
> "Jack" <Ja**@discussions.microsoft.com> wrote in message
> news:50**********************************@microsof t.com...
> > You just had wonderful advise, Curt. Thanks a ton. Instead of
> > disabled, I had to change the properties to readonly. With the
> > texts and the checkbox being disabled, the values are not been
> > passed to the sql processing and database saving asp page.
> > However, with readonly attribute, this problem does not arise.
> >
> > Only one problem still exists. That is, with the checkbox, the
> > readonly property did not work. The disbled property cannot be
> > applied due to the reasons explained above. Do you have any idea,
> > how to make the checkbox 'useless' i.e. users will not be able to
> > click and uncheck the checkbox now. I am yet to come up with an
> > idea. Any thoughts. Regards.
> >
> > "Curt_C [MVP]" wrote:
> >
> >> correct...
> >> <%
> >> if cbool(l_IsChecked)
> >> isDisabled = " disabled " else
> >> isDisabled = " "
> >>
> >> <input type="text" name="txt_CurrentOutlay" <%= isDisabled %>
> >> ......
> >>
> >>
> >> --
> >> Curt Christianson
> >> Site & Scripts: http://www.Darkfalz.com
> >> Blog: http://blog.Darkfalz.com
> >>
> >>
> >> "Jack" <Ja**@discussions.microsoft.com> wrote in message
> >> news:06**********************************@microsof t.com...
> >> > Thanks for your insight Curt, I appreciate it. Here is the code
> >> > of the checkbox: <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"%>>
> >> >
> >> > while one of the textbox in the asp page is coded as:
> >> > <input type="text" name="txt_CurrentOutlay" size="13"
> >> > value="<%Response.Write FormatCurrency(l_cu_CurrentOutlay,2)%>"
> >> > style="font-family: Times New Roman; font-size:
> >> > 12pt"></font></td> Now, are you suggesting to use the value of
> >> > l_IsChecked to be utilized in the input tag of the text boxes?
> >> > Need a little clarification here. Regards
> >> >
> >> >
> >> >
> >> >
> >> >
> >> > "Curt_C [MVP]" wrote:
> >> >
> >> >> You will have to get the value of the checkbox when the page
> >> >> loads. I would use a simple string value to hold a " disabled
> >> >> " or " " text string. Then
> >> >> in
> >> >> ALL of your controls do a <input..... <%= YourValue %> ...>
> >> >>
> >> >>
> >> >> --
> >> >> Curt Christianson
> >> >> Site & Scripts: http://www.Darkfalz.com
> >> >> Blog: http://blog.Darkfalz.com
> >> >>
> >> >>
> >> >> "Jack" <Ja**@discussions.microsoft.com> wrote in message
> >> >> news:24**********************************@microsof t.com...
> >> >> >I have a asp form where among others there are few text boxes
> >> >> >and one check
> >> >> > box. The checkbox is
> >> >> > to indicate whether the entry is final. The checkbox is
> >> >> > attahced to a field in table of type yes/no.
> >> >> > After saving the documents,the form is refreshed. At this
> >> >> > point, if the checkbox has been saved with checked, it shows
> >> >> > unchecked, if it has been saved unchecked it shows
> >> >> > unchecked.
> >> >> >
> >> >> > Here, if the checkbox shows checked, I want to disable (or
> >> >> > lock) all the text boxes and the checkbox itself
> >> >> > which will prevent further entry.
> >> >> >
> >> >> > Can this be done with asp? Any suggestion/help is highly
> >> >> > appeciated. Previous postings did not help to get this
> >> >> > resolved. Regards.
> >> >>
> >> >>
> >> >>
> >>
> >>
> >>
>
>
>


--
Adrienne Boswell
http://www.cavalcade-of-coding.info
Please respond to the group so others can share
Jul 22 '05 #11

P: n/a
Thanks to Mike and Adrienne for the respective advise. Mike, your code
just works fine. Though my intention was to use asp to find this solution,
I could not come up with one. Not sure it can be done so. Anyhow, the
Javascript solved the lingering issue. Thanks again. Regards.

"Mike D" wrote:
I wish I remember where this came from but put this in the head of the page
<SCRIPT LANGUAGE="JavaScript" >
function dont_touch(form) {
if (form.checked) {
form.checked = false
} else {
form.checked = true
}
}
</SCRIPT>

Then put this inside the checkbox tags onClick='dont_touch(this)'

It's javascript not asp but sounds like what you want.

Mike

"Jack" wrote:
I have no idea yet how to handle the onclick stuff. I am consulting the web
for some help. Could you shed some light with the code, if you recall.
Regards. Again, I appreciate all your generous help.

"Curt_C [MVP]" wrote:
we had a similar issue with checkboxes. What we did to work around it was
add an onClick() so that if it was checked and someone clicked it, it
automatically, re-checked itself.

--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Jack" <Ja**@discussions.microsoft.com> wrote in message
news:50**********************************@microsof t.com...
> You just had wonderful advise, Curt. Thanks a ton. Instead of disabled, I
> had
> to change the properties to readonly. With the texts and the checkbox
> being
> disabled, the values are not been passed to the sql processing and
> database
> saving asp page. However, with readonly attribute, this problem does not
> arise.
>
> Only one problem still exists. That is, with the checkbox, the readonly
> property did not work. The disbled property cannot be applied due to the
> reasons explained above. Do you have any idea, how to make the checkbox
> 'useless' i.e. users will not be able to click and uncheck the checkbox
> now.
> I am yet to come up with an idea.
> Any thoughts. Regards.
>
> "Curt_C [MVP]" wrote:
>
>> correct...
>> <%
>> if cbool(l_IsChecked)
>> isDisabled = " disabled "
>> else
>> isDisabled = " "
>>
>> <input type="text" name="txt_CurrentOutlay" <%= isDisabled %> ......
>>
>>
>> --
>> Curt Christianson
>> Site & Scripts: http://www.Darkfalz.com
>> Blog: http://blog.Darkfalz.com
>>
>>
>> "Jack" <Ja**@discussions.microsoft.com> wrote in message
>> news:06**********************************@microsof t.com...
>> > Thanks for your insight Curt, I appreciate it. Here is the code of the
>> > checkbox:
>> > <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"%>>
>> >
>> > while one of the textbox in the asp page is coded as:
>> > <input type="text" name="txt_CurrentOutlay" size="13"
>> > value="<%Response.Write FormatCurrency(l_cu_CurrentOutlay,2)%>"
>> > style="font-family: Times New Roman; font-size: 12pt"></font></td>
>> > Now, are you suggesting to use the value of l_IsChecked to be utilized
>> > in
>> > the input tag of the text boxes? Need a little clarification here.
>> > Regards
>> >
>> >
>> >
>> >
>> >
>> > "Curt_C [MVP]" wrote:
>> >
>> >> You will have to get the value of the checkbox when the page loads. I
>> >> would
>> >> use a simple string value to hold a " disabled " or " " text string.
>> >> Then
>> >> in
>> >> ALL of your controls do a <input..... <%= YourValue %> ...>
>> >>
>> >>
>> >> --
>> >> Curt Christianson
>> >> Site & Scripts: http://www.Darkfalz.com
>> >> Blog: http://blog.Darkfalz.com
>> >>
>> >>
>> >> "Jack" <Ja**@discussions.microsoft.com> wrote in message
>> >> news:24**********************************@microsof t.com...
>> >> >I have a asp form where among others there are few text boxes and one
>> >> >check
>> >> > box. The checkbox is
>> >> > to indicate whether the entry is final. The checkbox is attahced to
>> >> > a
>> >> > field
>> >> > in table of type yes/no.
>> >> > After saving the documents,the form is refreshed. At this point, if
>> >> > the
>> >> > checkbox has been saved with checked,
>> >> > it shows unchecked, if it has been saved unchecked it shows
>> >> > unchecked.
>> >> >
>> >> > Here, if the checkbox shows checked, I want to disable (or lock) all
>> >> > the
>> >> > text boxes and the checkbox itself
>> >> > which will prevent further entry.
>> >> >
>> >> > Can this be done with asp? Any suggestion/help is highly appeciated.
>> >> > Previous postings did not help
>> >> > to get this resolved. Regards.
>> >>
>> >>
>> >>
>>
>>
>>

Jul 22 '05 #12

This discussion thread is closed

Replies have been disabled for this discussion.