Note that there are some explanatory texts on larger screens.

plurals
  1. POSend selected options with javascript to URL?
    primarykey
    data
    text
    <p>Is it possible to send selected options with javascript to the url ? In my case it seems to be the only solution. My code is very basic. My problem is also, that i have to handle smarty (i hate smarty)</p> <pre><code>{block name="frontend_detail_buy"} &lt;select name="lieferperiode" id="lieferperiode"&gt; &lt;option value="{$sArticle.ordernumber|replace:"a":"a"}"&gt;jede Woche&lt;/option&gt; &lt;option value="{$sArticle.ordernumber|replace:"a":"b"}"&gt;alle 2 Woche&lt;/option&gt; &lt;option value="{$sArticle.ordernumber|replace:"a":"c"}"&gt;alle 3 Woche&lt;/option&gt; &lt;option value="{$sArticle.ordernumber|replace:"a":"d"}"&gt;jeden Monat&lt;/option&gt; &lt;/select&gt; &lt;select name="menge" id="menge"&gt; &lt;option value="1"&gt;1&lt;/option&gt; &lt;option value="2"&gt;2&lt;/option&gt; &lt;option value="3"&gt;3&lt;/option&gt; &lt;option value="4"&gt;4&lt;/option&gt; &lt;option value="5"&gt;5&lt;/option&gt; &lt;option value="6"&gt;6&lt;/option&gt; &lt;option value="7"&gt;7&lt;/option&gt; &lt;option value="8"&gt;8&lt;/option&gt; &lt;option value="9"&gt;9&lt;/option&gt; &lt;/select&gt; &lt;script type="text/javascript"&gt; var lieferung = document.getElementById("lieferperiode"); var periode = lieferung.options[lieferung.selectedIndex].value; var mengen = document.getElementById("menge"); var anzahl = mengen.options[mengen.selectedIndex].value; var link = "http://XXXXX.de/XXXXX.php/sViewport,checkout/sAction,addArticle/sAdd," + periode + "/sQuantity," + anzahl; {/block} </code></pre> <p>As you can see, the link contains 2 vars that are changeable via the dropdown menu. i made a test with alert and document.write and it is always giving me error var link is undefined. what am i doing wrong guys? cheers </p>
    singulars
    1. This table or related slice is empty.
    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. 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