How to get values of multiple select in contact form magento? -


i have code on form.phtml, custom multiple select.

<select name="projecttype[]" multiple="multiple">     <option value="" selected>select...</option>     <option value="kitchen remodeling">kitchen</option>     <option value="refacing">reface</option>     <option value="counter tops">counters</option>     <option value="bathroom remodeling">bathrooms</option>     <option value="flooring">floors</option>     <option value="lighting">lights</option>     <option value="other">others</option>                    </select> 

now problem is, how values if lets select "floors , lights" in contact form. because in normal select option, have project type: {{var data.projecttype}} in custom form email template. 1 multiple select. first time encounter problem can't find source guide on internet guide this. hope , guide me this.

if need value of multiselect box, can use jquery that. see below sample code.

<select id="multipleselect" name="projecttype[]" multiple="multiple">     <option value="" selected>select...</option>     <option value="kitchen remodeling">kitchen</option>     <option value="refacing">reface</option>     <option value="counter tops">counters</option>     <option value="bathroom remodeling">bathrooms</option>     <option value="flooring">floors</option>     <option value="lighting">lights</option>     <option value="other">others</option>                    </select>  <div onclick="javascript:getvalues();">test me</div>   <script type="text/javascript"> function getvalues(){ var selectedvalues = jquery('#multipleselect').val(); alert(selectedvalues);//alert if want } </script> 

when click on test me <div>, can see values selected.

the above demo code. can change per needs.


Comments

Popular posts from this blog

php - render data via PDO::FETCH_FUNC vs loop -

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

The canvas has been tainted by cross-origin data in chrome only -