Jump to content


Photo

HTML FORM Buttons


  • Please log in to reply
2 replies to this topic

#1 rydiemikey

rydiemikey
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 22 February 2006 - 06:56 PM

Does anybody know how to get rid of the carriage return when you close a form?

Here's an example of my problem.

I have a toolbar consisting of form buttons that link to different pages on the site. These buttons are in a table with the options <table border=0 cellpadding=0 cellspacing=0>. The problem is that the toolbar has gotten too long, and when I cut the bar and drop half to a new row, I get a line of whitespace between the two rows. I experimented with this, and it seems that the <form> code is appending a line break or carriage return to the end of the button. I determined this by commenting out sections of my code until I got it to work.

Using buttons like this in a two row, borderless table will leave a line of whitespace between rows due to the line break or carriage return:
<form action="path/page.html" method=\"link\">
<input type="submit" name="test" value="test">
</form>

But, if you remove </form> like this:
<form action="path/page.html" method=\"link\">
<input type="submit" name="test" value="test">

Then you don't get the whitespace. Your buttons don't work, however. When you remove the </form> tag, what happens is that every button in the table takes you to the same place as the link in the first button in the table (the first form to open). I'd really like to keep the buttons in tables, because it makes it easier to control them as a toolbar 'unit'. I don't know how to work around this though. Separating the two rows into two tables doesn't work, because the whitespace is in the cell with the button, like this:

------------
|BUTTON|
|<blank>|
------------

When what I want is:

------------
|BUTTON|
------------

Anyone have any ideas?

Thanks for any/all help.

Ryan

BTW, I am aware that you can make a link button by using the <button> tag and some Java. The thing is, I'd like to avoid Java if at all possible. I know that just about everybody has it, but I'd like to not be dependent on what the user may or may not have installed.

#2 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 22 February 2006 - 07:19 PM

It's a matter of style. Adjust to suit:
<form style="margin:0; padding:0;" action="path/page.html" method=\"link\">

Legend has it that reading the manual never killed anyone.
My site

#3 rydiemikey

rydiemikey
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 22 February 2006 - 07:39 PM

Thank you very much for the code. I knew there had to be a way to do it, I just couldn't find it. I looked through the manual, but, to be honest, I was trying to multitask (something I am singularly unqualified to do) and I probably looked right past it.

Thanks again.

Ryan




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users