Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

how to make a passed session variable readonly?

Posted on 2005-05-15
9
Medium Priority
?
297 Views
Last Modified: 2012-06-22
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.
0
Comment
Question by:NZ7C
  • 4
  • 3
8 Comments
 
LVL 14

Accepted Solution

by:
dfu23 earned 2000 total points
ID: 14006852
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
 

Author Comment

by:NZ7C
ID: 14007005
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
 
LVL 7

Expert Comment

by:chisholmd
ID: 14007144
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:NZ7C
ID: 14007200
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
 
LVL 14

Expert Comment

by:dfu23
ID: 14024350
Just curious,

If I was 100% correct why wasn't my comment accepted as the answer (or an assist)?
0
 

Author Comment

by:NZ7C
ID: 14024591
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
 
LVL 14

Expert Comment

by:dfu23
ID: 14026242
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
 

Author Comment

by:NZ7C
ID: 14029644
dfu23 -
I submitted a request through community support to transfer the points to you. Hopefully that will work.
Regards, NZ7C
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses
Course of the Month13 days, 13 hours left to enroll

581 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question