81
General / Re: anyform error
« Last post by datahell on February 09, 2024, 19:37:38 »This can be for a couple of reasons such as different php versions and XML settings. However there are issues in your XMLs. As you have only pasted a part of it (I guess the rest of it is OK) I will make notes only on things I see from your post.
A SELECT field may have some options once of which is the pre-selected. Check this:
<item type="select" name="callclient" label="Best time to call" default="" tip="Best time to call, your Local Time?">
<option value="anytime">Anytime</option>
<option value="10:00">10:00</option>
<option value="12:00">12:00</option>
...
</item>
The default value is not one of the SELECT options. Better make it like that: <option value="">Anytime</option>
Similar for the other fields:
<item type="checkbox" name="comms" label="Communication methods *" default="2" tip="Methods of communication allowed">
<option value="Telephone">Telephone</option>
<option value="Mobile">Mobile</option>
<option value="Email" checked="checked">Email</option>
<option value="Post">Post</option>
<option value="SMS">SMS</option>
<option value="Video">Video conferencing</option>
</item>
Tip: provide integers as values, eg:
<option value="1">Telephone</option>
<option value="2">Mobile</option>
When sending submitted forms the plugin will replace the selected option values with the corresponding texts.
Some else that might help for the error is to use CDATA in texts. Example:
<item type="openfieldset" label="<![CDATA[Extra Contact Information]]>" />
An other one: Check if the file's encoding is wrong, for instance it might have been saved as UTF-8 with hidden BOM characters. The correct character encoding is UTF-8 without BOM.
Finally: Use available language strings for the labels and options were possible. For instance instead of this:
<item type="text" name="name" label="First name *" required="1" default="{FIRSTNAME}" tip=""></item>
Use this:
<item type="text" name="name" label="FIRSTNAME" required="1" default="{FIRSTNAME}" tip=""></item>
The minimum available language strings for a plugin are listed in the following files:
Generic language file: languages/en/en.php
Component content: language/en/en.com_content.php
Plugin's (Anyform) language file: components/com_content/plugins/anyform/language/en.plugin_anyform.php
For instance if you use the string "PURPOSE_OF_TRIP" in a label it will be translated automatically to "Purpose of the Trip" (listed in Anyform language file).
A SELECT field may have some options once of which is the pre-selected. Check this:
<item type="select" name="callclient" label="Best time to call" default="" tip="Best time to call, your Local Time?">
<option value="anytime">Anytime</option>
<option value="10:00">10:00</option>
<option value="12:00">12:00</option>
...
</item>
The default value is not one of the SELECT options. Better make it like that: <option value="">Anytime</option>
Similar for the other fields:
<item type="checkbox" name="comms" label="Communication methods *" default="2" tip="Methods of communication allowed">
<option value="Telephone">Telephone</option>
<option value="Mobile">Mobile</option>
<option value="Email" checked="checked">Email</option>
<option value="Post">Post</option>
<option value="SMS">SMS</option>
<option value="Video">Video conferencing</option>
</item>
Tip: provide integers as values, eg:
<option value="1">Telephone</option>
<option value="2">Mobile</option>
When sending submitted forms the plugin will replace the selected option values with the corresponding texts.
Some else that might help for the error is to use CDATA in texts. Example:
<item type="openfieldset" label="<![CDATA[Extra Contact Information]]>" />
An other one: Check if the file's encoding is wrong, for instance it might have been saved as UTF-8 with hidden BOM characters. The correct character encoding is UTF-8 without BOM.
Finally: Use available language strings for the labels and options were possible. For instance instead of this:
<item type="text" name="name" label="First name *" required="1" default="{FIRSTNAME}" tip=""></item>
Use this:
<item type="text" name="name" label="FIRSTNAME" required="1" default="{FIRSTNAME}" tip=""></item>
The minimum available language strings for a plugin are listed in the following files:
Generic language file: languages/en/en.php
Component content: language/en/en.com_content.php
Plugin's (Anyform) language file: components/com_content/plugins/anyform/language/en.plugin_anyform.php
For instance if you use the string "PURPOSE_OF_TRIP" in a label it will be translated automatically to "Purpose of the Trip" (listed in Anyform language file).