Forum Moderators: phranque

Message Too Old, No Replies

Why Does A Form with a Post Method Always add a <cr>

Frustration has set in

         

Stidd

9:41 pm on Apr 18, 2003 (gmt 0)

10+ Year Member



This is perhaps the most frustrating thing I've ever seen...
I know Im Doing something wrong. No matter what I Do, The Final result always has the appearance of a Carriage Return or Break at the Bottom leaving alovely white gap of pure emptiness and lack of content...

<table width="800" border="1" cellspacing="0" cellpadding="0">
<tr>
<td width="329">&nbsp;</td>
<td height="1"><form method="post" action="http://www.example.com/cgi-bin/ts.pl">
<INPUT TYPE="HIDDEN" NAME="index" VALUE="#######">
<TABLE BGCOLOR="WHITE" CELLSPACING=0 CELLPADDING=0 BORDER=0>
<TR>
<TD width="32"><A HREF="http://www.example.com/" TARGET="_top"><IMG BORDER="_BORDERTYPE" SRC="http://www.example.com/example.gif" ALT="example"></A></TD>
<TD width="185"><INPUT TYPE="TEXT" NAME="query2" VALUE="" SIZE="20"></TD>
<TD width="185"><INPUT TYPE="SUBMIT" VALUE="Search" name="SEARCH"></TD>
</TR>
</TABLE>
</form></td>
</tr>
</table>

[edited by: Woz at 2:05 am (utc) on April 22, 2003]
[edit reason] took out specifics [/edit]

davemarks

9:47 pm on Apr 18, 2003 (gmt 0)

10+ Year Member



The form element has padding applied to it by default like a paragrapgh tag

Try this

<form style="margin-bottom:0;">

Stidd

9:49 pm on Apr 18, 2003 (gmt 0)

10+ Year Member



Yea! Sweeet. That Worked Thank you!

Stidd

4:04 pm on Apr 21, 2003 (gmt 0)

10+ Year Member



Wondering if you Form Experts can Give me a Hand.... Feel bad about leeching information from you guys...

Trying to setup a Form that allows the user to Browse His PC for JPG GIF, TIFF and BMP files type in a description of the image and by clicking "submit" (or whatever) automatically emailing it out to an address... this is how far I have gotten.... Thanks again....

<form style="margin-bottom:0; margin-top:0; margin-left:0; margin-right:0;" action="mailto:someone@example.com">
<table>
<tr>
<td>E-mail Address:</td>
<td><input name="sender" type="text" size="24"></td>
</tr>
<tr>
<td>Description:</td>
<td> <input type="text" name="description" size="24" maxlength="100"></td>
</tr>
<tr>
<td>Find Image:</td>
<td><input name="file" type="file" size="15" accept="image/gif; image/jpg; image/tiff; image/x-ms-bmp"></td>
</tr>
<tr>
<td><input name="submit" type="submit" id="submit" value="Send It!">
</td>
</tr>
</table>
</form>

[edited by: Woz at 2:18 am (utc) on April 22, 2003]
[edit reason] took out specifics [/edit]

grahamstewart

1:58 am on Apr 22, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



..and? Doesn't that work?

If you are looking for suggestions for improvement then:

  • change the form style to "margin:0", which does the same as "margin-bottom:0; margin-top:0; margin-left:0; margin-right:0;" but in less bytes.

  • use the <label> tag (e.g. <label for="description">Description:</label> )

  • don't use tables for layout. Use CSS positioning instead.
  • grahamstewart

    1:59 am on Apr 22, 2003 (gmt 0)

    WebmasterWorld Senior Member 10+ Year Member



    Oh and please remove your email address from this post. URL dropping is against the policy of this board.

    pageoneresults

    2:48 am on Apr 22, 2003 (gmt 0)

    WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



    Hmmm, you could also do...

    form{display:inline;}

    Stidd

    1:21 pm on Apr 22, 2003 (gmt 0)

    10+ Year Member



    My apologies grahamstewart.... Was not aware that my email address was in the post. Won't Happen again.

    grahamstewart

    1:35 pm on Apr 22, 2003 (gmt 0)

    WebmasterWorld Senior Member 10+ Year Member



    No worries. I didn't mean to sound so grumpy. :)
    Must have caught me before my morning coffee.

    Stidd

    6:09 pm on Apr 22, 2003 (gmt 0)

    10+ Year Member



    This is turning out to be quite a learning experience for me.....
    graham it does work.. But not quite exactly what I had in mind. Instead of the Form opening up the users email client, I would rather the entire message with the image file attachment get emailed to the specified email address.
    I found this sweet spot that tutors the entire FORM process but Im still stuck on what should be happening on the '.cgi' end of things. If I use this...

    <form method="POST" action="/cgi-bin/whatever.cgi"
    enctype="multipart/form-data">
    <input type="file" name="upfile" accept="image/*">
    <input type="text" name="description" size="##" maxlength="##">
    <input type="submit" name="send" value="Send">

    What specific should I have in the cgi file to accept and email the given data? I know about the following....

    #!/usr/bin/perl5 - Where Perl is Located on the Server
    $mailprogram = '/usr/sbin/sendmail'; - the SendMail Program on the Server..

    I Have to open the Mail Program... I see that there are variables for the mail program...
    $mail attachment works right?

    grahamstewart

    11:12 pm on Apr 22, 2003 (gmt 0)

    WebmasterWorld Senior Member 10+ Year Member



    Webhosts often provide standard cgi scripts (such as formmail) for doing this kind of thing. You might want to ask them what they have.