attribute value in a html button

M

Matt

The code
<input type="button" name="btn" value="ok">

will produce a html button with caption ok and value ok.
The problem is the width of button is dependent on the length of
attribute value.

And I do the following, which is not a good solution.

<input type="button" name="btn" value=" ok ">

The problem is if I want to get the button's value:
Request.Form("btn"), then I need to trim the data.

any ideas??
 
N

Neal

The code
<input type="button" name="btn" value="ok">

will produce a html button with caption ok and value ok.
The problem is the width of button is dependent on the length of
attribute value.

And I do the following, which is not a good solution.

<input type="button" name="btn" value=" ok ">

The problem is if I want to get the button's value:
Request.Form("btn"), then I need to trim the data.

any ideas??


Assign a class to the input, like "ok"

<input type="button" name="btn" value="ok" class="ok">

Then add a CSS rule:

input.ok {width: 10em;}
 
R

rf

Matt said:
The code
<input type="button" name="btn" value="ok">

will produce a html button with caption ok and value ok.
The problem is the width of button is dependent on the length of
attribute value.

And I do the following, which is not a good solution.

<input type="button" name="btn" value=" ok ">

The problem is if I want to get the button's value:
Request.Form("btn"), then I need to trim the data.

any ideas??

<input type="button" name="btn" value="ok" style="width: 12em;">
 
M

Mitja

Matt said:
The code
<input type="button" name="btn" value="ok">

will produce a html button with caption ok and value ok.
The problem is the width of button is dependent on the length of
attribute value.

And I do the following, which is not a good solution.

<input type="button" name="btn" value=" ok ">

The problem is if I want to get the button's value:
Request.Form("btn"), then I need to trim the data.

any ideas??

a) specify width with css

b) [more flexible, slightly less supported]
Use <button style="padding: 0 1em">ok</button> instead.

HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top