how to make a passed session variable readonly?

The following line receives a value for callsign from a registration form via a session variable:

<input type="text" name="callsign" id="myfield" value="<%= session("callsign")%>" size="8" maxlength="8" />

once the passed variable appears on the form I would like to make it readonly so that the registrant cannot change it at that point.  Is this possible and how would the code appear? Thank you.
NZ7CAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

 
dfu23Commented:
To stay with what appears to be XHTML syntax:

<input type="text" name="callsign" id="myfield" value="<%= session("callsign")%>" size="8" maxlength="8" readonly="readonly" />
0

Experts Exchange Solution brought to you by ConnectWise

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
 
NZ7CAuthor Commented:
Thank you for helping!.

 When I open the form as a stand alone page, after inserting your  code above,, you can not indeed  place a cursor or enter text in the blank form field - which is great!

 HOWEVER, when I activate the form on the site and actually pass the session variablle to it - it still allows me to place a cursor in the text box and edit. Thus the passing of the varaible seems to overide the readonly aspect. Any ideas?
0
 
chisholmdCommented:
You can add an additional hidden field

<input type="HIDDEN" name="callsign" id="myfield" value="<%= session("callsign")%>" size="8" maxlength="8" readonly="readonly" />

Or try disabled="disabled"



-------------------------------------
Hunter
http://www.lonecrow.net/wul/lingerie/lingerielinks.asp
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
NZ7CAuthor Commented:
dfu23 was 100% correct. I discovered a was forwarding the session variable to an ialmost identical form with different name. His answer works perfectly. Thank you very much for the help.
0
 
dfu23Commented:
Just curious,

If I was 100% correct why wasn't my comment accepted as the answer (or an assist)?
0
 
NZ7CAuthor Commented:
Oh rats! I clicked the wrong person dfu23 - I am most sorry! You were 100% correct and I thought I marked your answer as accepted - but apparently I clicked on chisholmd by accident. The 500 points should have gone all to dfu23.

I'm not familiar enough with the mechanics of this forum, but can I report my blunder to a site administrator and have the points reallocated 100% to you?  I really do apologize - your answer was right on the money. Please let me know if you are aware of a means for me to undo and reallocate the points. Thank you.
0
 
dfu23Commented:
Post a question for 0 points here:

http://www.experts-exchange.com/Community_Support/

Make sure you mention this question (Q_21424928) and what you want to do ...
0
 
NZ7CAuthor Commented:
dfu23 -
I submitted a request through community support to transfer the points to you. Hopefully that will work.
Regards, NZ7C
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.