Change action and image src url's with jQuery
<p>I am parsing a form from another one of my sites using a php proxy. It is working fine but the form action and img src of the submit button url's are relative. How can I prepend the full http//www.domain.com/ in front of each of the url's in the form?</p>

<p>Edit:</p>

<p>Here's the form code once fed through to the new domain:</p>

<pre><code> &lt;div style="display: none;" id="SubscribeForm" class="newform"&gt;

            &lt;h5&gt;Subscribe to our newsletter&lt;/h5&gt;

            &lt;form action="/CampaignProcess.aspx?ListID=27057" method="post" onsubmit="return checkWholeForm93426(this)" name="catemaillistform93426"&gt;

                &lt;div class="form"&gt;

                &lt;div class="item"&gt;

                &lt;label for="CLFullName"&gt;Full Name&lt;/label&gt;

                &lt;br /&gt;

                &lt;input type="text" maxlength="255" id="CLFullName" name="FullName" class="cat_textbox_small" style="background-color: #ffffa0;" /&gt;

                &lt;/div&gt;

                &lt;div class="item"&gt;

                &lt;label for="CLEmailAddress"&gt;Email Address&lt;/label&gt;

                &lt;br /&gt;

                &lt;input type="text" maxlength="255" id="CLEmailAddress" name="EmailAddress" class="cat_textbox_small" style="background-color: #ffffa0;" /&gt;

                &lt;/div&gt;

                &lt;div class="item"&gt;

                &lt;label&gt;Enter Word Verification in box below&lt;/label&gt;

                &lt;br /&gt;

                &lt;div class="captchaimg"&gt;&lt;img src="/captchahandler.ashx?ID=22791bf65054422cadeb4aea9390cfaa&amp;amp;Color=DimGray&amp;amp;ForeColor=White&amp;amp;Width=160" alt="Captcha Image" /&gt;&lt;/div&gt;

    &lt;input id="CaptchaV2" class="cat_textbox" type="text" name="CaptchaV2" style="width:160px" /&gt;

    &lt;input id="CaptchaTV2" type="text" name="CaptchaTV2" style="display:none;" /&gt;

    &lt;input id="CaptchaHV2" type="hidden" value="22791bf65054422cadeb4aea9390cfaa" name="CaptchaHV2" /&gt;



                &lt;/div&gt;

                &lt;div class="item"&gt;

                &lt;p&gt;We respect your privacy and will never share your details.&lt;/p&gt;

                &lt;/div&gt;

                &lt;div class="item"&gt;

                &lt;input type="image" src="/images/submit-button-white-bg_07.gif" id="catlistbutton" value="Subscribe" class="cat_button" /&gt;

                &lt;/div&gt;

                &lt;/div&gt;

                &lt;script type="text/javascript" src="http://testsite.businesscatalyst.com/CatalystScripts/ValidationFunctions.js"&gt;&lt;/script&gt;

                &lt;script type="text/javascript"&gt;function checkWholeForm50598(theForm){var why = "";if (theForm.EmailAddress) why += checkEmail(theForm.EmailAddress.value);if (theForm.CaptchaV2) why += isEmpty(theForm.CaptchaV2.value, "Enter Word Verification in box below"); if (why != ""){alert(why);return false;}theForm.submit();return false;}&lt;/script&gt;

            &lt;/form&gt;
&lt;/div&gt;
</code></pre>

<p>and here's the jQuery I am using to try and change the action url:</p>

<pre><code>jQuery(document).ready(function($) {
  $('form').each(function(index) {
    var urls = $(this).attr('action');
    var dom = 'http://www.sampleurl.com';
    $(this).attr('action',dom+urls);
  });
});
</code></pre>

<p>All other jQuery functions are working well on the page so I know it is not an issue with jQuery itself.</p>
