dcsimg
www.webdeveloper.com
Results 1 to 5 of 5

Thread: Form input/submit button help

  1. #1
    Join Date
    Oct 2012
    Posts
    38

    Form input/submit button help

    Hey guys so I'm in a need of some assistance, I am looking to make a mini site with some code. and what I wanted it to be is like the following

    Date: Input Field
    Phone Number: Input Field
    Customer name: Input Field
    email address: Input Field
    issue: Input Field
    results: Input Field

    Submit

    I then want to have a submit button under all this, and what I want to be able to do is have the submit button when pressed to open up a new tab with the information i just inputted saved, but also to be able to go back to the input field and add a second batch of information for another customer, so that no matter what i can keep saving into the same tab and see the results from all the submissions. this is idealy what i would like to begin with





    This is the below code that i found

    but i also would like the text aligned in the center but with the other text and the input boxes centered and aligned with each other

    Any help would be greatly appreciated.

    HTML Code:
    <HTML>
          <HEAD>
            <TITLE>Contact</TITLE>
    
            <script type="text/javascript">
    
              function addtext()
              {
                 var fname = document.myform.first_name.value;
                 var lname = document.myform.last_name.value;
                 var email = document.myform.email.value;
    
                 document.writeln("<pre>");
                 document.writeln("First Name    : " + fname);
                 document.writeln("Last Name     : " + lname);
                 document.writeln("Email Address : " + email);
              }
            </script>
          </HEAD>
          <BODY>
    
          <center>
    <b>CONTACT US</b> <br></br>   
    <form name="myform">
    
      <label for="first_name">Date </label>
      <input  type="text" name="first_name" maxlength="50" size="30">
        <br>
      <label for="last_name">Last Name </label>
      <input  type="text" name="last_name" maxlength="50" size="30">
        <br>
      <label for="email">Email Address</label>
      <input  type="text" name="email" maxlength="80" size="30">
        <br>
      <input type="submit" value="Submit" onClick="addtext()">
    
    </form>
    
        </BODY>
        </HTML>

  2. #2
    Join Date
    Mar 2007
    Location
    localhost
    Posts
    2,805
    What is the purpose of having the new pop up? Keep in mind that people have popup blockers, so for all your efforts you are going to have problems with browsers that actively block attempts for websites to open a popup window.

    If you are taking information that will be entered in to a website database, then submit it to the server and any issues thereafter, the returning page can relay that information or you can have a server echo what was sent to the server. It is a much better option as the site then won't be subjected to the popup blocker policy.
    STOP using $ prefix on JavaScript variable names...
    Please remember to wrap any code you have in forum tags:-

    [CODE]...[/CODE] [HTML]...[/HTML] [PHP]...[/PHP]

    If you can't think outside the box, you will be trapped forever with no escape...

  3. #3
    Join Date
    Oct 2012
    Posts
    38
    This is for my own personal use.

    so all i want is some assistance on how exactly to do this cause i know its possible,

  4. #4
    Join Date
    Oct 2012
    Posts
    38
    is there anyone that can help me please

  5. #5
    Join Date
    Mar 2007
    Location
    localhost
    Posts
    2,805
    Try changing <form name="myform"> to <form name="myform" onsubmit="return false;"> and see what happens.
    STOP using $ prefix on JavaScript variable names...
    Please remember to wrap any code you have in forum tags:-

    [CODE]...[/CODE] [HTML]...[/HTML] [PHP]...[/PHP]

    If you can't think outside the box, you will be trapped forever with no escape...

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles