Session("locked") issue

J

Jack

I have a form that has few text boxes to input. However, after saving, if the
user comes back to the same form, then the input boxes should be locked. I
would like to know whether this can be handled by session("locked") variable
or any other way. Any information to handle this concept is appreciated.
Thanks.
 
J

John Blessing

I have a form that has few text boxes to input. However, after saving, if
the
user comes back to the same form, then the input boxes should be locked. I
would like to know whether this can be handled by session("locked")
variable
or any other way. Any information to handle this concept is appreciated.
Thanks.

No. The interaction with the user is through the browser (i.e. client-side),
asp runs server-side before the page is displayed. Making input boxes
readonly is possible but it is IIRC supported in some browsers (IE) only.
You could, based on the value of a session var, display the values using
text instead of input boxes, e.g.

if session ("locked") then
response.write "Input box 1 " & myvalue
else
response.write "Input box 1 <input type =text name=myinput1>"
end if
--
John Blessing

http://www.LbeHelpdesk.com - Help Desk software priced to suit all
businesses
http://www.room-booking-software.com - Schedule rooms & equipment bookings
for your meeting/class over the web.
http://www.lbetoolbox.com - Remove Duplicates from MS Outlook
news:[email protected]...
 
A

Adrienne Boswell

No. The interaction with the user is through the browser (i.e.
client-side), asp runs server-side before the page is displayed.
Making input boxes readonly is possible but it is IIRC supported in
some browsers (IE) only. You could, based on the value of a session
var, display the values using text instead of input boxes, e.g.

if session ("locked") then
response.write "Input box 1 " & myvalue
else
response.write "Input box 1 <input type =text name=myinput1>"
end if

The readonly attribute is supported in most modern browsers, eg.
<input type="text" name="variable" id="variable" value="<%=variable%>"
readonly>

for XHTML:
<input type="text" name="variable" id="variable" value="<%=variable%>"
readonly="readonly" />

The thing to consider is that users can be confused and still try to get
focus in the input element. Another option is to use
disabled="disabled", but that is hard to read and ugly. One could always
use some sort of CSS on the input box, perhaps change the background
colour, etc.

IMHO, the best thing to do is as suggested and write out the information,
and also put that information in type="hidden" input boxes, if the data
has to go to another script.
 

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

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top