Jump to content

HTML FORM Buttons


rydiemikey

Recommended Posts

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.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.