Note that there are some explanatory texts on larger screens.

plurals
  1. POGet form popup upon successful submission
    primarykey
    data
    text
    <p>How do I go about getting this form to display "Submitted" using basic javascript popup window upon successful submission?</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;Site :: &lt;/title&gt; &lt;link rel="stylesheet" media="screen" href="css/wicahost.css" /&gt; &lt;link rel="stylesheet" media="screen" href="css/global.css" /&gt; &lt;script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.js"&gt;&lt;/script&gt; &lt;?php require_once('inc/php/clearfieldJs.php'); ?&gt; &lt;script type="text/javascript"&gt; $(document).ready(function() { $("#splashtease").RSV({ rules: [ "required,emAdd,Please enter your email address.", "valid_email,emAdd,Please enter a valid email address.", ] }); }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;script src="http://www.benjaminkeen.com/software/rsv/jquery/jquery.rsv.js"&gt;&lt;/script&gt; &lt;div id="splashTeaserBox"&gt; &lt;h1 class="wicasplashcenter"&gt;Signup!&lt;/h1&gt; &lt;div class="wicasplashcenter"&gt;Captivating interests and inspiring collaboration.&lt;/div&gt; &lt;form id="splashtease" action="inc/subscribe.php" method="post"&gt; &lt;?php $usrBrowser = $_SERVER['HTTP_USER_AGENT']; $todayDt = date('Y-m-d'); ?&gt; &lt;input type="text" name="emAdd" class="splashtease" value="Your Email Address ..." onFocus="clearText(this)" /&gt; &lt;input type="hidden" name="brwsr" value="&lt;?php echo $usrBrowser; ?&gt;" style="margin:0; padding:0;" /&gt; &lt;input type="hidden" name="dt" value="&lt;?php echo $todayDt; ?&gt;" style="margin:0; padding:0;" /&gt; &lt;input type="submit" name="submit" value="" class="splashteasesub" /&gt; &lt;/form&gt; &lt;/div&gt;&lt;!--splashTeaserBox--&gt;&lt;/body&gt; &lt;/html&gt; </code></pre> <p><strong>PHP</strong></p> <pre><code> &lt;?php $host="localhost"; // Host name $username="root"; // Mysql username $password=""; // Mysql password $db_name="dnbame"; // Database name $tbl_name="subscriber"; // Table name // Connect to server and select databse. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); /* Obliterate bad input */ $goodEmail = mysql_real_escape_string($_POST['emAdd']); $goodBrowser = mysql_real_escape_string($_POST['brwsr']); $goodDate = mysql_real_escape_string($_POST['dt']); $sql= "INSERT INTO subscriber (Email, Browser, DateSubscribed) VALUES('$goodEmail','$goodBrowser','$goodDate')"; $result = mysql_query($sql); if (!$result) { die('Invalid Email, please retry.'); } else{ echo var success; } ?&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload