I am trying to use a select box to store a list of responses, but I have a limited width of which I can use. I have set a width for the select box, but my responses are longer then the width so they are getting cut off. I would like the responses to then wrap so the entire response can be viewed. I know if I don't set the width the window will stretch to accommodate it, but I don't have the area to do this. Can anybody please help? Even if it means using javascript I would be willing to try it. Thank you

Maybe you can show what are the text and it is not needed to be wrapped maybe it just need to be rephrased.

No even if I rephrase it it would still be pretty long. I have looked into that and it is a good thought, but the responses are as short as they can be.

Can you put some text boxes out to the sides, and connect them with key letters (e.g., box D) to the select boxes?

no the replies have to be in the select box for the user to click on directly. Very good thought though, but the replies have to be in the select box.

would something like this work

<textarea rows='7' cols='35' style='float:right;' id='bigbox'></textarea>
<select id='sel' onchange='document.getElementById("bigbox").innerText=document.getElementById("sel").value'>
<option alt='' value='' disabled>Select</option>
<option value=' this long text1 this is more text and still more this long text1 this is more text and still more this long text1 this is more text and still more'> short text 1 </option>
<option value='this is a long text  test2 this is a long text  test2 this is a long text  test2 this is a long text  test2 this is a long text  test2 this is a long text  test2 '> short text 2 </option>
<option value='this is a test3 this is a long text  testthis is a test3 this is a long text  testthis is a test3 this is a long text  testthis is a test3 this is a long text  testthis is a test3 this is a long text  testthis is a test3 this is a long text  testthis is a test3 this is a long text  test'> short text 3 </option>
<option value='this is a test4 this is a test4 this is a test4 this is a test4 this is a test4 this is a test4 this is a test4 this is a test4 '> short text 4 </option>
<option value=' this is a test5 this is a test5 this is a test5 this is a test5 this is a test5 this is a test5'> short text 5 </option>
<option value='this is a test6 this is a test6 this is a test6 this is a test6 this is a test6 '> short text 6 </option>
</select>
<button type="submit" title="Click To Submit completed form" onclick='return confirm("Are you Sure ? ");' name="submit" value="Send" >Send</button>

Long text in value= could be the full string from the database, short text something like substr($string,20);

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.