D-O-M Posted September 20, 2010 Share Posted September 20, 2010 I would like to be able to select subject of message going from contact form by radio-button instead of drop-down list. Can anyone please give some advice. tia Link to comment Share on other sites More sharing options...
rocky Posted September 20, 2010 Share Posted September 20, 2010 This is actually much trickier than I thought it would be. You can change lines 19-24 of contact-form.tpl from: {l s='-- Choose --'} {foreach from=$contacts item=contact} {$contact.name|escape:'htmlall':'UTF-8'} {/foreach} to: {foreach from=$contacts item=contact} <input type="radio" name="id_contact" id="id_contact_{$contact.id_contact|intval}" value="{$contact.id_contact|intval}" style="float: left; padding: 0; width: auto; border: none" /> {$contact.name|escape:'htmlall':'UTF-8'} {/foreach} I had to add lots of style code, since the default style causes the radio buttons to display incorrectly. It would be better to move this to global.css if possible.Also, I had to remove the description that comes up when changing options, since the showElemFromSelect function is expecting a "select" rather than an "input". You'd need to rewrite that function if you want the descriptions to display. Link to comment Share on other sites More sharing options...
D-O-M Posted September 20, 2010 Author Share Posted September 20, 2010 rocky almighty, thank you again, showElemFromSelect was the point where my logics started to overheat, i think i can live without descriptions Link to comment Share on other sites More sharing options...
brandonc503 Posted April 30, 2012 Share Posted April 30, 2012 (edited) im actually trying to mess with the tools.js file to show the descriptions, any help? found ansewer.. add this to /js/tools.js $(document).ready(function() { $('.contact_radio').click(function() { $('.desc_contact').hide(); $('#desc_contact' + $(this).val()).show(); }); }); and give the <input type="radio" <input type="radio" id="id_radio1" class="contact_radio" name="id_radio" value="{$contact.id_contact|intval}" onclick="showElemFromSelect('id_radio1', 'desc_contact1')" > *this is assuming there is jquery loaded. thanks to Clorith Edited April 30, 2012 by brandonc503 (see edit history) Link to comment Share on other sites More sharing options...
Ron morales Posted September 9, 2013 Share Posted September 9, 2013 (edited) in prestashop 1.5.4.1 now showing thanks! Edited September 9, 2013 by Ron morales (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts