About attributes

Consider the code
<form name="form1" method="post" action="">

<input type ="text" name="Heading1" value="" style="font-family:Times New Roman;font-size:20">
if i submitted this form then by the next page i can get the value of Heading1 by
request.form("Heading1")
how i can get the font-size and font-family when user submitted the page.I don't want to use hidden variables.
I have done with hidden fields but i want to directly get
these values without using hidden fields.
how it can be done.


MumtazAsked:
Who is Participating?
 
knightEknightConnect With a Mentor Commented:
mouatts suggestions are very good, but to get the values from a form, hidden fields are best -- unless you want to put them in the session first and then use them to write your pages -- but then why get them from the form since you would already know them since they are in the session?  Oh well, I hope we helped in some way.
0
 
knightEknightCommented:
request.form can only be used for getting values of the form elements (and their names if necessary), no other attributes can be aquired that way.  Hidden fields are the way to go.
0
 
MumtazAuthor Commented:
suppose there are twenty fields in a form and every field have different color and
font-family.Then for thsi i have to 40 hidden variables in a form.and 20 filelds
then almost 60 variables for one man who fill it on line.Suppose thre are thounds
of user to that form then it will be burden on the server.
I want to optimize the variables.
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
mouattsCommented:
KeK is right you can only get the name value pairs back HTTP doesn't support anything else.

The question is why do you need to get the info back. As you have sent them out in the first place then you must know what they are. If you are allowing users to change style preferences, for example, then the solution would be to save them within session variables (or application if they can't change them). If the valuies are stored using the field name them it is easy to match them up eg

Session("heading1") would contain "font-family:Times New Roman;font-size:20".

If you wanted to go a stage further you could store all the attributes in this way eg
Session("heading1_style")
Session("heading1_size")

Thus if you wish to output the page that had been receieved you could use some thing like

FOR EACH field IN REQUEST%>
 <INPUT TYPE="<%=session(field&"_type")%>" NAME="<%=field%>" SIZE="<%=Session(field&"_size")%>">
NEXT

HTH
Steve

0
 
MumtazAuthor Commented:
Kek
I already knew this.You send me answer i will accept it.
0
 
kodiakbearCommented:
Fixed the -1 problem on this question.
Escrow points corrected.

kb
Community Support Moderator
Experts Exchange
0
All Courses

From novice to tech pro — start learning today.