techsavyy Posted October 8, 2014 Report Posted October 8, 2014 I want to create checkbox for I agree to Terms & Conditions. But when I add link to label attribute of checkbox. it shows <a> tag as it is. How can I add html attribute to the label of checkbox? techsavyy 1 Quote
0 Tyson Posted October 8, 2014 Report Posted October 8, 2014 I think you need to be more specific as to what you're trying to do and how and where it applies in Blesta. Some simple HTML markup to accomplish what you're asking would be: <label> <input type="checkbox" name="tos" value="true" /> I agree to <a href="#">Terms & Conditions</a> </label> Michael 1 Quote
0 techsavyy Posted October 9, 2014 Author Report Posted October 9, 2014 I want to display terms and conditions in module for domain registration. I have written code as following in config file. Configure::set("domain_fields.nl",array( 'Term' => array( 'label' => Language::_("domain.Terms",true), 'type' => "checkbox", 'options' => array( 'Yes' => Language::_("domain.RegistryTerms",true) ) ) ); Currently if i write <a href="#">Terms & Conditions</a> in Language::_("domain.RegisteryTerms",true), it show as it is instead of showing it as link. Quote
0 Tyson Posted October 9, 2014 Report Posted October 9, 2014 Content is escaped when displayed, so the label attribute in the config would not be the place to include HTML. Instead, you could create a new attribute to include your custom link and language, then update the module where that field is rendered to check for those attributes and generate the HTML manually. In this case, you wouldn't be able to use ModuleFields, unless you left the label as plain-text, and set javascript that updated the plain-text to a link when the page is displayed. e.g. Configure::set("domain_fields.nl",array( 'Term' => array( 'label' => Language::_("domain.Terms",true), 'type' => "checkbox", 'options' => array( 'Yes' => Language::_("domain.RegistryTerms",true) ), 'custom_label_link' => "http://domain.com/", 'custom_label_name' => Language::_("domain.terms", true) ) ); Then look for 'custom_label_link'/'custom_label_name' in your module, and make adjustments accordingly. While not identical, the Namecheap module does something similar in order to include tooltips. You can take a look at that module for reference. Michael 1 Quote
Question
techsavyy
I want to create checkbox for I agree to Terms & Conditions.
But when I add link to label attribute of checkbox. it shows <a> tag as it is.
How can I add html attribute to the label of checkbox?
3 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.