Login   Register  
Icontem

File: examples/result.html

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Chara Miteo  >  JS Form Validator  >  examples/result.html  >  Download  
File: examples/result.html
Role: Example script
Content type: text/plain
Description: Examples
Class: JS Form Validator
Validate forms according to many rules
Author: By
Last change:
Date: 2014-01-14 05:50
Size: 2,137 bytes
 

Contents

Class file image Download
<html>
<head>
	<title>ApPHP :: JS Auto Form Validator :: Result</title>
	<link href="css/style.css" type="text/css" rel="stylesheet" />
    <script>
        
    function getValues()
    {
        // First, we load the URL into a variable
        var url = window.location.href;
      
        // Next, split the url by the ?
        var qparts = url.split("?");
      
        // Check that there is a querystring, return "" if not
        if (qparts.length == 0)
        {
          return "";
        }
      
        // Then find the querystring, everything after the ?
        var query = qparts[1];
      
        // Split the query string into variables (separates by &s)
        var vars = query.split("&");
      
        // Initialize the value with "" as default
        var value = "";
      
        // Iterate through vars, checking each one for varname
        for (i=0;i<vars.length;i++)
        {
          // Split the variable by =, which splits name and value
          var parts = vars[i].split("=");
          
          // Check if the correct variable
          //if (parts[0] == varname)
          //{
            // Load value into variable
            value += "["+parts[0]+"] = "+parts[1]+"<br />";
      
            // End the loop
            //break;
          //}
        }
        
        // Convert escape code
        value = unescape(value);
      
        // Convert "+"s to " "s
        value.replace(/\+/g," ");
      
        // Return the value
        return value;
    }
    
        
    </script>
</head>
<body>

<h4>Submission completed!</h4>

<p>
    Your form was successfully submitted! Thank you for your information. 
    <br /><br />
    Click <a href="javascript:history.go(-1)">here</a> to start again.
    <br /><br /><br />

    <b>Submitted data:</b><br />
    <div id="msg_text" style='border:1px solid #cccccc;padding:10px;margin-top:5px;background-color:#f1f2f3;'></div>
</p>

<script>
    var res = getValues();
    document.getElementById("msg_text").innerHTML = res;
</script>

</body>
</html>