www.webdeveloper.com
Results 1 to 2 of 2

Thread: Javascript Form Question

  1. #1
    Join Date
    Apr 2010
    Posts
    1

    Javascript Form Question

    Hi guys I'm very new to javascript. I'm currently making a form, where after I press the submit button, on the page it displays the information I have entered.

    Can some please just give me some pointers on how to implement this?

    Thanks In Advance
    Anel

  2. #2
    Join Date
    Mar 2010
    Posts
    2,803
    This link

    http://www.w3schools.com/xhtml/default.asp

    at w3schools will show you how to build a form and then you can use this file as the form's action attribute to display the forms input data when you click submit.


    PHP Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
    >
    <
    html xmlns="http://www.w3.org/1999/xhtml">
    <
    head>
    <
    title>Form Processor</title>
    </
    head>
    <
    body>
    <
    script type="text/javascript">
    <!-- 
    HIDE FROM INCOMPATIBLE BROWSERS
    if (window != top)
     
    top.location.href=location.href
    document
    .write("<h1>Your form has been submitted!</h1><h2>You entered the following data:</h2>");
    var 
    formData location.search;
    formData formData.substring(1formData.length);
    while (
    formData.indexOf("+") != -1) {
     
    formData formData.replace("+"" ");
    }
    formData unescape(formData);
    var 
    formArray formData.split("&");
    for (var 
    i=0formArray.length; ++i) {
     
    document.writeln(formArray[i] + "<br />");
    }
    // STOP HIDING FROM INCOMPATIBLE BROWSERS -->
    </script>
    </body>
    </html> 

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