Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You need to use preventDefault() to prevent the browser from simply following the link, also you are putting your actions inside the submit event of your form, but you have no submit button, and you are not triggering the submit event, so that event never fires. In this case you don't need to submit the form, so you can simply make use of the link click event to open the iframe using the data entered in the form. Like so </p> <pre><code> &lt;script&gt; $(document).ready(function() { $("a[rel=zipformSubmit]").click(function(e) { e.preventDefault(); var zip = $('#zip').val(); alert("about to open colorbox with zipcopde " + zip); $.colorbox({href: "?zip=" + zip, iframe:true, innerWidth:800, innerHeight:600}); }); }); &lt;/script&gt; </code></pre> <p>Note: some validation would be good <code>if (zip.length &gt; 0) { }</code> etc</p> <p><strong>Added after Comment:</strong></p> <p>IN order to bring in your <code>$_GET['Source']</code> you should add a hidden form field:</p> <pre><code> &lt;div class="form-zip-start"&gt; &lt;p&gt;Enter your zip code to begin your search:&lt;/p&gt; &lt;form id="submit" action="#" name="submit" method="post"&gt; &lt;input type='hidden' name='source' id='source' value='&lt;?php echo $_GET['Source']; ?&gt;' /&gt; &lt;input name="zip" id="zip" type="text" value="" class="zip-start" /&gt; &lt;div class="form-submit"&gt;&lt;a href="/form.htm" rel="zipformSubmit" class="zipformSubmit"&gt;Submit&lt;/a&gt;&lt;/div&gt; &lt;/form&gt; &lt;/div&gt; </code></pre> <p>then make the js:</p> <pre><code>&lt;script&gt; $(document).ready(function() { $("a[rel=zipformSubmit]").click(function(e) { e.preventDefault(); var zip = $('#zip').val(); var source = $('#source').val(); alert("about to open colorbox with zipcopde " + zip); $.colorbox({href: "?source="+source+"&amp;zip=" + zip, iframe:true, innerWidth:800, innerHeight:600}); }); }); &lt;/script&gt; </code></pre>
    singulars
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      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