jQuery pass clicked image src to fancybox popup form
<p>I have a popup form which is activated upon clicking an image, I've used fancybox to have the lightbox effect. What I would like is for one of the form fields to be auto-filled with the clicked images src. I have tried the following but to no effect (nothing in console shopwing an error):</p>

<pre><code>jQuery("#storefront li img").click(function() {
    var barimg = jQuery(this).prop("src");
    jQuery("input[name=car]").val(barimg);
});
</code></pre>

<p>HTML for form:</p>

<pre><code>               &lt;div style="display:none"&gt;
                    &lt;form method="POST" action="thanks.asp" id="modalbar"&gt;
  &lt;div class="formwrapper"&gt;
    &lt;label for="name"&gt;Name &lt;span class="red2"&gt;*&lt;/span&gt;&lt;/label&gt;
    &lt;input type="text" name="FirstName"&gt;
    &lt;/div&gt;

  &lt;div class="formwrapper"&gt;
    &lt;label for="car"&gt;Car (Please include &lt;strong&gt;Make&lt;/strong&gt; / &lt;strong&gt;Model&lt;/strong&gt; / &lt;strong&gt;Year&lt;/strong&gt;) &lt;span class="red2"&gt;*&lt;/span&gt;&lt;/label&gt;
    &lt;input type="text" name="Car"&gt;
    &lt;/div&gt;

    &lt;div class="formwrapper"&gt;
    &lt;label for="reg"&gt;Reg Number&lt;/label&gt;
    &lt;input type="text" name="Reg"&gt;
    &lt;/div&gt;

  &lt;div class="formwrapper"&gt;
    &lt;label for="phone"&gt;Telephone Number&lt;/label&gt;
    &lt;input type="text" name="Tel"&gt;

    &lt;/div&gt;

  &lt;div class="formwrapper"&gt;
    &lt;label for="email"&gt;Email Address &lt;span class="red2"&gt;*&lt;/span&gt;&lt;/label&gt;
    &lt;input type="text" name="EmailFrom"&gt;

    &lt;/div&gt;

  &lt;div class="formwrapper"&gt;
    &lt;label for="prefcontact"&gt;Preferred Contact Method &lt;span class="red2"&gt;*&lt;/span&gt;&lt;/label&gt;
    &lt;input type="text" name="ConMeth"&gt;

    &lt;/div&gt;

  &lt;div class="formwrapper"&gt;
    &lt;label for="maillist"&gt;Join Mailing List&lt;/label&gt;
    &lt;input type="checkbox" name="MailList" value="Yes" checked="checked"&gt;
    &lt;/div&gt;

  &lt;div class="field"&gt;  
    &lt;input name="submit" type="submit" value="Send Form" class="contactsend" /&gt;
    &lt;input name="reset" type="reset" value="Clear Form" class="contactsend" /&gt;
    &lt;/div&gt;
&lt;/form&gt;
&lt;/div&gt;
</code></pre>

<p>Basic fancybox:</p>

<pre><code>jQuery(".modaltowbartrigger").fancybox({
    'scrolling'     : 'no',
    'titleShow'     : false
});
</code></pre>

<p>any pointers would be greatly appreciated?</p>