Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

select issue

Status
Not open for further replies.

dakoz

Programmer
Feb 2, 2002
74
hi all,

i have the following problem : i want to make a list in html using a simple form. i take dynamically the fields in the <option> using the following code :

<SELECT class=price size=15 multiple name=list1>

<%
IF Session(&quot;CubeName&quot;)<>&quot;&quot; THEN
For di = 0 To cdf.Dimensions.Count - 1

Response.Write &quot;<option value=&quot;& cdf.Dimensions(di).Name &&quot;>&quot;& cdf.Dimensions(di).Name &&quot;</option>&quot;


IF cdf.Dimensions(di).Name=Request.form(&quot;dimension&quot;) then
hi=di
END IF
NEXT
END IF
%></SELECT>


the problem is the following : the form is generated ok. It seems that all is good, but at the <option value=...>
if i have a field for example &quot;Story Type&quot; takes as value only the Store and leaves the Type!!


any Suggestions??
 
You can't use a space in the value attribute. Use either Story_Type or StoryType

BDC.
 
:) that wont do!!

anyway i found it hope someday this help someone...


esponse.Write &quot;<option value='&quot;& cdf.Dimensions(di).Name &&quot;'>&quot;& cdf.Dimensions(di).Name &&quot;</option>&quot;

The single quotes gives you the entire string.

 
The reason this is the case is that when you have no quotes around the value for an attribute in a tag, the browser has to decide whether to keep reading everything as a value, or stop and assume that anything following is a possible new attribute. Since there is a greater loss of efficiency if it continues to read, but also checks each word to see if it is a valid attribute and should stop reading it as part of the value of the previous attribute, browsers instead only read up to a space character if their are no quotes involved. The rest is assumed to be attributes and if they are not valid attributes are ignored.

As more browsers implement XHTML, it will become more and more important to use quotes around attribute values, as this will speed up the renedering of the page and not cause possible future problems when people do put in multiple word values that you had not foreseen and provided for (ie, quotes).

-Tarwn

01010100 01101001 01100101 01110010 01101110 01101111 01101011 00101110 01100011 01101111 01101101
29 3K 10 3D 3L 3J 3K 10 32 35 10 3E 39 33 35 10 3K 3F 10 38 31 3M 35 10 36 3I 35 35 10 3K 39 3D 35 10 1Q 19
Get better results for your questions: faq333-2924
Frequently Asked ASP Questions: faq333-3048
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top