Simple(i think) and quick form quetion...please help

Discussion in 'HTML & Website Design' started by theshangsta, Aug 31, 2009.

  1. #1
    hello all, I have a pretty simple (i hope) question that is simply too simple for me

    I have a form on my website that collects customer data using a php script that i've been working on. In the form, I wanted to add a questions/comments box to the bottom, right before the submit button.

    I wanted to just use an input type=text just like the rest of the fields on my form, but realized that you can't make a text input multiple lines (or can you?) without using TEXTAREA

    So, I wrote in a textarea field above the submit button, below everything else. for some reason however, when i published it...it published in the wrong position, in between 2 user input fields. So then I wrapped the TEXTAREA in <td> and <tr> and that but me in the right spot, but then it extended my page and made everything go out of porportion (made the page too wide, even though the textarea had less columns than my form)

    I need help. here's part of the code:
    
    <table cellspacing=3>
    <tr><td>Type of Card:<td colspan="3">
    <Input type='Radio'Name='Cardtype'value='Mastercard'>MC
    <Input type='Radio'Name='Cardtype'value='Visa'>VISA
    <Input type='Radio'Name='Cardtype'value='AMEX'>AMEX</td></tr>
    
    <table cellspacing=3>
    <tr><td>Account #:<td colspan="3">
    <input size=20 maxlength=20 type=text name=cardnumber
    <td>Exp Date:<td colspan="3">
    <input size=6 maxlength=6 type=text name=exp
    <td>CVV2#:<td colspan="3">
    <input size=6 maxlength=6 type=text name=cvv2
    <td></td></tr>
    
    
    <table cellspacing=3>
    <tr><td>Name on Card:<td colspan="3">
    <input size=50 maxlength=50 type=text name=cardname
    </td></tr>
    
    
    <table cellspacing=3>
    <tr><td>Billing Address for above card:<td colspan="3">
    <input size=50 maxlength=50 type=text name=address
    </td></tr>
    
    <tr><td colspan="3"><Input type = 'checkbox' Name ='agree' value= 'I have read, understand and agree to the terms & conditions of this agreement.'>I have read, understand and agree to the <a href="maintterms.html"  target="popsome"">  Terms and Conditions</a> of this agreement.</td></tr><br>
    
    <b><u>Comments:</u></b><TEXTAREA NAME="comments" COLS=40 ROWS=6></TEXTAREA>
    
    
    
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td><input type=submit value=" Submit " name=submit style="font-size: 10pt; font-family: Tahoma"></td></tr>
    </table>
    </div>
    </form>
    						
    												
    
    						</div>
    					</td>
    				</tr>
    			</table>
    		</td>
    	</tr>
    	<tr>
    		<td bgcolor="#B1DDF2" style="border-top: 1px solid #015885">
    HTML:
    again, I just want a comment box under all the form data but before the submit button, if there is an easier way or a different way you prefer to do this, please let me know. all help is appreciated.

    thank you:)
     
    theshangsta, Aug 31, 2009 IP
  2. lucian00

    lucian00 Peon

    Messages:
    38
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    <input size=50 maxlength=50 type=text name=address
    HTML:
    you forgot to close input with ">"
     
    lucian00, Aug 31, 2009 IP
  3. theshangsta

    theshangsta Peon

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    haha, thanks for pointing that out!


    But unfortunately that still does not solve my problem.......I'm actually surprised the address field worked at all without the closing....but it worked perfectly.


    I still need to get this comment field up and running...i mean it is up and running, just not in the right place lol :confused:
     
    theshangsta, Aug 31, 2009 IP
  4. Necrospasm

    Necrospasm Peon

    Messages:
    76
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    <form action="" method="">
    <table cellspacing="3">
    <tr><td>Type of Card:</td>
    <td>
    <Input type="Radio" Name="Cardtype" value="Mastercard">MC
    <Input type="Radio" Name="Cardtype" value="Visa">VISA
    <Input type="Radio" Name="Cardtype" value="AMEX">AMEX
    </td></tr>
    
    <tr><td>Account #:</td>
    <td>
    <input size="20" maxlength="20" type="text" name="cardnumber">
    </td>
    <td>Exp Date:</td>
    <td>
    <input size="6" maxlength="6" type="text" name="exp">
    </td>
    <td>CVV2#:</td>
    <td>
    <input size="6" maxlength="6" type="text" name="cvv2">
    </td></tr>
    
    <tr><td>Name on Card:</td>
    <td>
    <input size="50" maxlength="50" type="text" name="cardname">
    </td></tr>
    
    <tr><td>Billing Address for above card:</td>
    <td>
    <input size="50" maxlength="50" type="text" name="address">
    </td></tr>
    
    <tr><td><Input type="checkbox" Name="agree" value="I have read, understand and agree to the terms & conditions of this agreement.">I have read, understand and agree to the <a href="maintterms.html" target="popsome">Terms and Conditions</a> of this agreement.</td><td></td></tr>
    
    <tr><td valign="top">
    <b><u>Comments:</u></b></td><td><TEXTAREA NAME="comments" COLS="40" ROWS="6"></TEXTAREA></td></tr>
    
    
    
    <td>&nbsp;</td>
    <td><input type=submit value="Submit" name="submit" style="font-size: 10pt; font-family: Tahoma;"></td></tr>
    </table>
    </form>
    Code (markup):
    Took the liberty to rewrite your code and fix it. Hope it helps. :)

    PS. I didn't take time to indent and stuff like that, thought I'd leave you some fun :p

    Basically, you had a whole bunch of errors opened <TD> without a closing </td> .. rowspans without the need of them being there, tables open in other tables without closing any of them with </table>. Always close your elements either with a <td></td> or if its a singular element such as <br> you self close it like so <br /> or <img />
     
    Necrospasm, Aug 31, 2009 IP
  5. theshangsta

    theshangsta Peon

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Hey necrospasm, thank you so much for taking the time to try and help me....


    but unfortunately the code you wrote for me skewed my page and messed up the formatting, i dont know if that's what you meant by letting me do the indenting....maybe it's because i forgot to mention this is just a small portion of a bigger form... but anyway, its all good....I solved the problem...


    the code i went with is:


    <table cellspacing=3>
    <tr>
    <td>Type of Card:</td>
    <td><Input type="Radio" Name="Cardtype" value="Mastercard">MC</td>
    <td><Input type="Radio" Name="Cardtype" value="Visa">VISA</td>
    <td><Input type="Radio" Name="Cardtype" value='AMEX'>AMEX</td>
    </td>
    </tr>
    
    
    <tr>
    <td>Account #:</td>
    <td><input size=20 maxlength=20 type=text name=cardnumber></td>
    <td>Exp Date:</td>
    <td><input size=6 maxlength=6 type=text name=exp></td>
    </tr>
    <tr>
    <td>CVV2#:</td>
    <td colspan="3"><input size=6 maxlength=6 type=text name=cvv2></td>
    </tr>
    <tr>
    <td>Name on Card:</td>
    <td colspan=3>
    <input size=50 maxlength=50 type=text name=cardname
    </td>
    </tr>
    
    <tr>
    <td>Billing Address for above card:</td>
    <td colspan="3">
    <input size=50 maxlength=50 type=text name=address>
    </td></tr>
    
    <tr><td colspan="4"><Input type = 'checkbox' Name ='agree' value= 'I have read, understand and agree to the terms & conditions of this agreement.'>I have read, understand and agree to the <a href="maintterms.html"  target="popsome"">  Terms and Conditions</a> of this agreement.</td></tr>
    <tr><td>
    <b><u>Comments:</u></b></td>
    <td colspan="3"><TEXTAREA NAME="comments" COLS=40 ROWS=6></TEXTAREA></td></tr>
    
    <tr><td colspan="4"><input type=submit value=" Submit " name=submit style="font-size: 10pt; font-family: Tahoma"></td></tr>
    </table>
    HTML:
     
    theshangsta, Aug 31, 2009 IP
  6. Necrospasm

    Necrospasm Peon

    Messages:
    76
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #6
    hmmm yeah i figured you had more stuff on your page when i saw the closing </div> at the end. It was just meant to be correct for you to hack it away to your needs. Glad you solved it but if you try to validate that page, its full of errors man. Paste your whole html file into http://validator.w3.org/ and you'll see what i mean.
     
    Necrospasm, Aug 31, 2009 IP
  7. theshangsta

    theshangsta Peon

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Thank you, that's a really good resource.
    I'm very interested in web designing, and am good with computers and technology....but I still have a wholeeee lot to learn.....

    I was wondering, what is the importance of being compliant with those rules as long as the page looks ok? I mean.....certain laws I must abide by as far as e-commerce I would imagine, but I mean I'm paying for my site, shouldn't I be able to code it how I like? Just wondering...

    Also, do I need to purchase a SSL certificate, And how can I go about security for my website? I already have anti virus and spam software on all my office desktops, and on my server where all my network data is stored (quickbooks, files, etc.) But my domain is hosted by an ISP we recently switched to, Do I need to do anything to ensure my customers privacy?

    thanks
     
    theshangsta, Sep 1, 2009 IP
  8. Necrospasm

    Necrospasm Peon

    Messages:
    76
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Ok, i'm gonna try to explain this as easy as possible. As you know, HTML is a language. Let's take the English Language as an example, just because you typed "This is a yelow ball", and people understand it, It's still a grammatical error (Yellow is spelled wrong :p). Now, search engines have to read your HTML code in order to properly index it so if your code has errors, chances are it either will index it incorrectly, or doesn't index it at all. Think of it as spray painting a car and making it very nice and shiny, buy you spray painted on rust. Sooner or later, problems will occur. Also, unvalidated (or non standardized) code will give you issues with cross-browser compatibility.

    Also, if you're really interested in web design, you'll take the time and do your job properly. Especially if you're aspiring to make it your career. No one will employ a sloppy designer/developer.

    As for SSL (Unless you're gonna use paypal) yes, you need an SSL Certificate installed on your hosting. It has nothing to do with antivirus. Basically what SSL (or HTTPS) does is encrypt the connection between your page, and the processing page. A certificate is simply exactly that, a certificate of authenticity that you are who you really say you are and the details transferred between your site and the credit card processor is encrypted.

    Hope that helps clear it up.
     
    Necrospasm, Sep 1, 2009 IP