Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 7 of 7

Thread: HTML Forms

  1. #1
    Junior Member
    Join Date
    May 2011
    Location
    Swindon
    Posts
    9
    Member #
    27744
    Hi

    I have been building a small form using HTML which contains a text box, two radio buttons and a button. Currently the button when selected will just reset the text box and the radio buttons, i am trying to change this so it opens another HTML page and pastes the data that has been inserted into the text box and the radio buttons into this page.

    I have tried to change this myself but currently all i can get it to is when the button is selected it opens the HTMl page i want it to but it does not paste the data in. My HTML code for this form currently looks like this:

    <form action="page.html" method="post">
    <fieldset>
    <legend>Testing form</legend>
    <p><label for="name">Name</label> <input type="text" id="name" /></p>
    <p><label for="male">Male</label> <input type="radio" value="male" id="male" name="gender" /></p>
    <p><label for="male">Female</label> <input type="radio" value="female" id="Female" name="gender" /></p>
    <p class="submit"><input type="submit" value="Submit" /></p><br/>
    </fieldset>
    </form>

    What it should do is open page.html and paste the data in so it looks like this:

    Your name is......and you are a ....

    Doi need to add an extra piece of code into the page.html, which gets the data from the data from that form?

    Can anyone help me with this??

    Thank you

    Jeskit

  2.  

  3. #2
    Senior Member Ronald Roe's Avatar
    Join Date
    Mar 2011
    Location
    Oklahoma City
    Posts
    3,141
    Member #
    27197
    Liked
    959 times
    Don't ask me how, but yes, you'll need a script to post to that will return the data in HTML format.
    Ron Roe
    Web Developer
    "If every app were designed using the same design template, oh wait...Bootstrap."

  4. #3
    Senior Member Webzarus's Avatar
    Join Date
    May 2011
    Location
    South Carolina Coast
    Posts
    3,322
    Member #
    27709
    Liked
    770 times
    Check the w3schools site. This can be done easily with JavaScript. Can't be done with just HTML .

  5. #4
    Senior Member glyakk's Avatar
    Join Date
    Nov 2003
    Location
    USA
    Posts
    1,263
    Member #
    3828
    Liked
    6 times
    Just FYI, the 'form action' should point to a file or script that can do the parsing you are wanting to do, usually it wil be a PHP page or ASP or whatever server side scripting language your host supports.. Perl anybody? TO give a quick overview of whats happening:

    When you fill out a form, and press submit, each element (ie text input, hidden input, etc) has an id assigned to it, it will store the data that form input has into a variable of sorts with the same name.. the action you have assigned to the form will take those variables that were obtained from the input fields and then parse them into the final rendered page.


  6. #5
    Member
    Join Date
    Aug 2011
    Posts
    64
    Member #
    28942
    Liked
    8 times
    I am currently looking to create a form as well.

    I can't find information on creating an .asp to accept data. Could someone maybe supply a link to where that might be explained?
    And what part of the W3school javascript section tells us how to use that to accept the form?

    I also ran into a sight called emailmeform.com that says it's free to sign up and get a custom form - just copy paste. Anyone have an opinion on that?

  7. #6
    Senior Member Webzarus's Avatar
    Join Date
    May 2011
    Location
    South Carolina Coast
    Posts
    3,322
    Member #
    27709
    Liked
    770 times
    JavaScript can't be used to send the data to you from the form( although I'm sure there are some scripts out there that are integrated with asp or php ), JavaScript is a client side language that only interacts with the users browser.

    It doesn't matter what scripting language you use to send the data, but you should really check with YOUR hosting provider to first determine what they support. Im guessing you're on a windows server or you wouldn't have mentioned ASP. if your hosting provider and your site is on a windows server and ALLOWS sending email using asp, they may have some examples in their support section that explain how they allow it to work. There is no single ( plug and play ) way of making it work, as servers are configures differently, and some providers required you to use an email account on their system to send mail, where some require you to point it to a central script on their server to send mail.

    Check with your hosting provider to see if they have any special requirements to send mail from their systems. Once you know that, we can help you with the FORM part, if they don't have examples.

  8. #7
    Member
    Join Date
    Aug 2011
    Posts
    64
    Member #
    28942
    Liked
    8 times
    Quote Originally Posted by Webzarus, post: 217065
    JavaScript can't be used to send the data to you from the form( although I'm sure there are some scripts out there that are integrated with asp or php ), JavaScript is a client side language that only interacts with the users browser.

    It doesn't matter what scripting language you use to send the data, but you should really check with YOUR hosting provider to first determine what they support. Im guessing you're on a windows server or you wouldn't have mentioned ASP. if your hosting provider and your site is on a windows server and ALLOWS sending email using asp, they may have some examples in their support section that explain how they allow it to work. There is no single ( plug and play ) way of making it work, as servers are configures differently, and some providers required you to use an email account on their system to send mail, where some require you to point it to a central script on their server to send mail.

    Check with your hosting provider to see if they have any special requirements to send mail from their systems. Once you know that, we can help you with the FORM part, if they don't have examples.
    Thank for the information. I mentioned .asp because in a lot of the examples I've seen the action sends to an .asp. I myself don't actually have a server as of yet. I am creating a design to present to a potential client. If they don't accept then I at least learned a LOT in the process of creating it. If they accept, then I will purchase a server, and then I will worry about creating a form.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 07:45 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com