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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

word wrap submit button?

Status
Not open for further replies.

Tracey

Programmer
Oct 16, 2000
690
NZ
hi.. i have a long-ish caption for a submit button in a form.

I would like to sqish it in width by breaking the caption into two... "Recalculate Hour Total" would split into two lines.

I know &quot;Recalculate <br>Hour Total&quot; doesnt work.

I know using an image is an option, however to create a button image is an unneccessary step IMHO.

Do I have any options?
 
Two that I can think of, one may work better for you.
1) Add a crlf instead of the break tag
Code:
<input type=&quot;button&quot; value=&quot;Recalculate&amp;#13;Hour Total&quot;>
Ascii character 13 is the carriage return, so it should line break it for you.
2) Specify a CSS width for the button and hope it wraps:
Code:
<input type=&quot;button&quot; value=&quot;Recalculate Hour Total&quot; style=&quot;width:90;&quot;>

Hope one of these helps,
-Tarwn
flip.gif
--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
 
aha

thank you Tarwn. I had tried &quot;Recalculate #13Hour Total&quot; and that hadnt worked. Of course... !! &#13;
 
hmm, now this is causing me some problems within my program

where i say

if Request.ContentFields.Values['Submit'] =
'Recalculate&#13;Actual Hours' then

doesnt trigger the code

and if i set the style, the words are still cut off



 
Why not have a hidden field that you send with the next action in it?
Code:
<form method=&quot;POST&quot; action=...etc
<input type=&quot;hidden&quot; name=&quot;next_action&quot; value=&quot;&quot;>
<input type=&quot;submit&quot; value=&quot;Recalculate&amp;#13;Actual Hours&quot; onClick=&quot;next_action.value='recalc'&quot;>
<input type=&quot;submit&quot; value=&quot;Enter More&amp;#13;Hours&quot; onClick=&quot;next_action.value='moreentry'&quot;>
</form>

This way you can have some set values that you are expecting and just set the next_action input on the button clicks. Then in your next page just create a simple case statement (or if stmt if only two options) to decide what to do based on the value of the next_action variable, similar to how your doing it now. the only real differance to the way your doing it now is the variable name (next_action) and the little bit of javascript to add in to set the value of that input.

-Tarwn --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top