Forum Moderators: open

Message Too Old, No Replies

setting form width for image

width of image in form puts image on next line

         

weddingm

8:27 pm on Apr 11, 2009 (gmt 0)

10+ Year Member



I am trying to set the width of a form so it stays on the same line in a table "td" with other items.

Please see code below and offer any help.

<form method='post' action='https://website.php' target='_blank'><input type='hidden' name='bname' value='".$bus."' WIDTH='0'><input type='hidden' name='bemail' value='".$userel."' WIDTH='0'><input type='image' SRC='images/envelope.gif' value='submit' alt='[Contact]' BORDER='1' WIDTH='16' hspace='0' vspace='0''></form></td>

Thanks,
Matt

rocknbil

10:36 pm on Apr 11, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



First - no width attribute on a hidden input, and width is invalid on input type="image" as well. I'm *pretty sure* the same is true of the border on input type="image", if you want a border you're best to style it. Or, use input type="submit" and style the submit with a background image.

Try

form { margin:0;padding:0; white-space: nowrap; }
#submit-img { border: 1px solid #000000; }

<td>
<form method='post' action='https://website.php' target='_blank'><input type='hidden' name='bname' value='".$bus."><input type='hidden' name='bemail' value='".$userel."><input type='image' id='submit-img' SRC='images/envelope.gif' value='submit' alt='[Contact]'></form></td>