Still not resolved. Need expert help

J

Jack

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.
 
J

Jack

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
 
J

Jack

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.
 
J

Jack

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.
 
A

Adrienne

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).
 
M

Mike D

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
 
A

Adrienne

Gazing into my crystal ball I observed =?Utf-8?B?TWlrZSBE?=
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.
 
J

Jack

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top