Javascript & HTML question

Posted:
in Genius Bar edited January 2014
So I got this site that Im trying to code that is basically an example for a form that would be used on a e-commerce site or the likes, and I've got the buttons and the fields sorted out but I cant get them so that it goes down the page like



Name:

Address

City

State

Zip

Visa





In addition I need to display all the values of the form fields via Javascript after the user submits all the information.



Here's my code:



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"

"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<header>

<title>Sample Form Site</title>

</header>



<body>





<input title="text" SIZE="50" style="background:00BFFF">



<input title="Send it off to me" type="button" style="background:ff00ff" value="OK. Send it!">



<input title="Send it off to me" type="button" style="background:ff00ff" value="Reset">



<input type="text" size="20" style="background:00BFFF" style="color:00ff00" value="">



<input type="image" src="" height="24" width="129" border=0 alt="picture button">



<b>Name:</b>:<input title="Your name goes here" type="text" size="20" style="background:00BFFF" value="Enter your name here"><br>

<b>Email:</b>:<input title="Your email goes here (like you didn't know that already)" TYPE="text" size="20" style="color:ff0000" style="background:00ff00" value="Enter your email here"><br>

<p>

Comments

  • Reply 1 of 3
    elricelric Posts: 230member
    I'm sure someone will scream about this but why not use a table to align your form elements. Its easy to do and it works well.
  • Reply 2 of 3
    Maybe if I knew how to do that.
  • Reply 3 of 3
    elricelric Posts: 230member
    Ok this is rough but it will give you the basic idea, oh and i didn't understand what some of those inputs were for so i just sorta left them at the end.



    [code]

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"

    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml">

    <header>

    <title>Sample Form Site</title>

    </header>



    <body>



    <table>

    <tr>

    <td width="20"><b>Name:</b></td>

    <td><input title="Your name goes here" type="text" size="20" style="background:00BFFF" value="Enter your name here"></td>

    </tr>

    <tr>

    <td><b>Email:</b></td>

    <td><input title="Your email goes here (like you didn't know that already)" TYPE="text" size="20" style="color:ff0000" style="background:00ff00" value="Enter your email here"></td>

    </tr>

    <tr>

    <td colspan="2"><input title="text" SIZE="50" style="background:00BFFF"></td>

    </tr>

    <tr>

    <td colspan="2" align="right"><input title="Send it off to me" type="button" style="background:ff00ff" value="OK. Send it!">

    <input title="Send it off to me" type="button" style="background:ff00ff" value="Reset"></td>

    </tr>

    <tr>

    <td colspan="2"><input type="text" size="20" style="background:00BFFF" style="color:00ff00" value=""></td>

    </tr>

    <tr>

    <td colspan="2"><input type="image" src="" height="24" width="129" border=0 alt="picture button"><td>

    </tr>

    </table>



    </body>

    </html>

    </pre><hr></blockquote>
Sign In or Register to comment.