About  attributes

Posted on 1999-07-27
Medium Priority
Last Modified: 2013-11-19
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
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.

Question by:Mumtaz
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 33

Expert Comment

ID: 1852482
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.

Author Comment

ID: 1852483
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.
LVL 11

Expert Comment

ID: 1852484
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

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

 <INPUT TYPE="<%=session(field&"_type")%>" NAME="<%=field%>" SIZE="<%=Session(field&"_size")%>">


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.


Author Comment

ID: 1852485
I already knew this.You send me answer i will accept it.
LVL 33

Accepted Solution

knightEknight earned 80 total points
ID: 1852486
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.

Expert Comment

ID: 6814378
Fixed the -1 problem on this question.
Escrow points corrected.

Community Support Moderator
Experts Exchange

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

718 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