<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
        <channel>
        <title>Русский клуб Joomla/Блог им. Dron79</title>
        <link>http://joomclub.net/en/profile/Dron79/created/topics/</link>
        <description><![CDATA[Это ваш персональный блог.]]></description>
        <language>ru</language>
        <managingEditor>dron79-79@yandex.ru</managingEditor>
        <webMaster>tena2000@mail.ru</webMaster>
        <generator>Alto CMS v.1.1.13</generator>
                    <item>
                <title>Смена action в form средствами jquery</title>
                <guid isPermaLink="true">http://joomclub.net/en/t/60/</guid>
                <link>http://joomclub.net/en/blog/60.html</link>
                <author>dron79-79@yandex.ru</author>
                <description><![CDATA[<p> Работая над написанием собственной системы управления заказами, столкнулся с необходимостью отправлять данные формы на разные URL в зависимости от того какая кнопка нажата. Так как мой движок все равно использует jquery, то решил что для этой задачи рационально его и использовать.</p>

<a name="cut" rel="nofollow"></a> 
<pre class="prettyprint"><code>&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; dir=&quot;ltr&quot; lang=&quot;ru-ru&quot; xml:lang=&quot;ru-ru&quot;&gt;
 &nbsp; &nbsp; &lt;head&gt;
 &nbsp; &nbsp; &nbsp; &nbsp; .&nbsp; .&nbsp; .
 &nbsp; &nbsp; &nbsp; &lt;script language=&quot;javascript&quot; type=&quot;text/javascript&quot; src=&quot;/js/jquery-1.8.2.min.js&quot;&gt;&lt;/script&gt;
 &nbsp; &lt;script language=&quot;javascript&quot; type=&quot;text/javascript&quot; &gt;
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; function sb(ev){
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var urlf=&quot;index.php?com=u&amp;z=list&quot;;
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (ev==&quot;apply&quot;) {
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; urlf=&quot;index.php?com=u&amp;z=add&amp;a=apply&quot;;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (ev==&quot;save&quot;) {
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; urlf=&quot;index.php?com=u&amp;z=add&amp;a=save&quot;;&nbsp; &nbsp;
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $(&quot;#adminForm&quot;).attr(&quot;action&quot;,urlf);&nbsp; //заменяем в форме атрибут action
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $(&quot;#adminForm&quot;).submit();&nbsp; //отправляем форму
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
   &nbsp; &lt;/script&gt;
 &nbsp; &lt;/head&gt;
&nbsp; &lt;body&gt;
           ...
&nbsp; &lt;span id=&quot;apply&quot;&nbsp; onclick=&quot;javascript: sb('apply')&quot; &gt;Применить &lt;/span&gt;
&nbsp; &lt;span id=&quot;save&quot;&nbsp; onclick=&quot;javascript: sb('save')&quot; &gt;Сохранить &lt;/span&gt;
            .....
 &nbsp; &lt;form name=&quot;adminForm&quot; method=&quot;post&quot; action=&quot;index.php&quot; id =&quot;adminForm&quot;&gt;
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .... 
 &nbsp; &lt;/form&gt;
 &nbsp; &lt;/body&gt;
 &lt;/html&gt;</code></pre>

<p>Код не сложный, но свои функции выполняет. Если кто знает более короткое решение, то буду рад с ним ознакомится.</p>]]></description>
                <pubDate>Sun, 07 Oct 2012 21:07:23 +0400</pubDate>
                            </item>
            </channel>
    </rss>
