Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can I send form content with different subjects
    primarykey
    data
    text
    <p>I need help with my contact formular on <a href="http://robert-richter.com" rel="nofollow">http://robert-richter.com</a> under the navigation point Kontakt. I want to send this form with different subjects. Dependung on with option is selected in the drop down menu, I want to create an individual subject. The reason why I want to do this is because I want to use a filter in my email account wich saves emails based on the sibject title.</p> <p>Example:</p> <p>Contact Form Name: John Alex Option Selected: Anfrage persönlich // german for private request</p> <p>Subject in Mailbox: Persönliche Anfrage von Alex John 23/08/2013</p> <p>Filter 'Persönliche Anfrage von' and save it in the folder 'Persönliche Anfragen' (eng: Private Requests)</p> <p>Im brand new to jQuery. This is what I got so far:</p> <pre><code>&lt;form action="#" method="post" title="Kontaktformular" class="ajax"&gt; &lt;div&gt;&lt;label for="name"&gt;Name&lt;/label&gt; &lt;input name="name" type="text" title="Name"&gt;&lt;/div&gt; &lt;div&gt;&lt;label for="email"&gt;E-Mail-Adresse&lt;/label&gt; &lt;input name="email" type="text" title="Email"&gt;&lt;/div&gt; &lt;div&gt;&lt;label for="auswahl"&gt;Präfix&lt;/label&gt; &lt;label class="label"&gt; &lt;select name="auswahl" class="dropdown"&gt; &lt;option selected value="Webdesign"&gt;Anfrage Webdesign&lt;/option&gt; &lt;option value="Persoenlich"&gt;Anfrage persönlich&lt;/option&gt; &lt;option value="Andere"&gt;Alles andere&lt;/option&gt; &lt;option value="Spam"&gt;Spam&lt;/option&gt; &lt;/select&gt; &lt;/label&gt;&lt;/div&gt; &lt;div&gt;&lt;textarea name="message" title="Nachricht"&gt;&lt;/textarea&gt;&lt;/div&gt; &lt;button value="Send" type="submit" class="button"&gt;Absenden&lt;/button&gt; &lt;/form&gt; //php file &lt;?php if (isset($_POST['name'], $_POST['email'],$_POST['auswahl'], $_POST['message'])) { print_r($_POST); } $('form.ajax').on('submit', function() { var that = $(this), url = that.attr('action'), type = that.attr('method'), data = {}; that.find('[name]').each(function(index, value) { var that = $(this), name = that.attr('name'), value = that.val(); data[name] = value; }); $.ajax({ url: url, type: type, data: data, success: function(response) { console.log(response); } }); return false; </code></pre> <p>});</p> <p><a href="http://jsfiddle.net/c5C8F/2/" rel="nofollow">http://jsfiddle.net/c5C8F/2/</a></p> <p>How can I add the selected option instead of the select element?</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