php sending parameters through a link from page1 and firing up javascript on page 2
<p>on page 1, I try to pass some parameters through a url to page2.
I want to fire up page2 and select the options as if i selected them on page2.</p>

<p>How can I pass #divOptionToTake, #divSelectChannel_btnSubmit, #selected_channel_new, #selChannels, #frmSelectChannel from page 1 and get it executed? Thanks.</p>

<p><strong>Page1</strong></p>

<p>...../page2.php?selected_channel=facebook&amp;option_to_take</p>

<p><strong>Page 2</strong></p>

<pre><code>&lt;html&gt;

  &lt;script type="text/javascript"&gt;        
    $(document).ready(function() {

        &lt;?php if($option_to_take == ""){ ?&gt;
        $.blockUI({ message: $('#divOptionToTake'), css: { width: '420px' } }); 
        &lt;?php } ?&gt;

        // SELECT CHANNEL
        $('#divSelectChannel_btnSubmit').click(function() {                
            $.unblockUI();
            $('#selected_channel_new').val($('#selChannels').val())
            $('#frmSelectChannel').submit();
            //return true;               
        });            

    });  
  &lt;/script&gt;

&lt;/html&gt;
</code></pre>

<p><strong>The code of the form is here.</strong></p>

<pre><code>&lt;form name="frmSelectChannel" id="frmSelectChannel" action="" method="POST"&gt;
&lt;input type="hidden" name="task" value="select_channel" /&gt;
&lt;input type="hidden" name="option_to_take" value="new campaign" /&gt;
&lt;input type="hidden" name="selected_channel" id="selected_channel_new" value="facebook" /&gt;
&lt;div id='divSelectChannel'&gt;
        &lt;select id='selChannels' class='span3'&gt;
                        &lt;option value="facebook" &lt;?php echo (($selected_channel == "facebook") ? "selected='selected'" : ""); ?&gt;&gt;facebook&lt;/option&gt;
                        &lt;option value="twitter" &lt;?php echo (($selected_channel == "twitter") ? "selected='selected'" : ""); ?&gt;&gt;twitter&lt;/option&gt;                                                         
        &lt;/select&gt;
            &lt;input class='btn btn-primary' type='submit' id='divSelectChannel_btnSubmit' value='Submit' /&gt;
        &amp;nbsp;&amp;nbsp;
              &lt;input class='btn' type='button' id='divSelectChannel_btnBack' value='Back' /&gt;
        &lt;/div&gt;
   &lt;/form&gt;
</code></pre>
