1- Create a checkbox field with type="checkbox"
2- Set the default value, for example: default="somevalue"
Checkbox field NOT checked with value="somevalue"
Checkbox field checked with value="somevalue"
Joomla 3.4.1
The value setting defines what will be submitted if checked. If "default" attribute is not defined, the default value is "1".
Currently, the only way to replace the "1" value is setting the "default" attribute, and if you do that, the field changes its state to checked.
Labels |
Removed:
?
|
Labels |
Added:
?
|
@Margreet137 quick test:
1- Change the "default" value in the "contact_email_copy" field in "components > com_contact > models > forms > contact.xml" from "0" to "test_response" (this is the value that will be submitted if checked)
2- Create a new contact or use already created one
3- Create a new contact menu and check the page. The checkbox "Send Copy to Yourself" is now "checked" and in the source you can see the "test_response" value.
Maybe using the type checkboxes with only one option would work for you. I tested with this:
<field name="contact_email_copy"
type="checkboxes"
class="checkbox inline"
id="contact-email-copy"
filter="options"
description="COM_CONTACT_CONTACT_EMAIL_A_COPY_DESC"
label="COM_CONTACT_CONTACT_EMAIL_A_COPY_LABEL"
>
<option value="test_response">JYES</option>
</field>
Please see #6794
closing here
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-04-22 14:44:35 |
Closed_By | ⇒ | brianteeman |
Want to test this issue but I don't see where you created the checkbox.
If I want to check if this issue is really an issue I need some more information.
Could you be some more specific?
This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6712.