Elxis CMS Forum

Support => General => Topic started by: xmanhattan on May 09, 2018, 12:49:43

Title: anyform drop down error
Post by: xmanhattan on May 09, 2018, 12:49:43
Hello all,

While trying to use these drop downs in the anyform xml file, I received errors on the 1st and the 3rd but not the 2nd one regarding the values.

Can someone see what is wrong with this code?

Code: [Select]
<item type="select" name="Best time to call" label="Best time to call" default="" tip="Select Best time to call, your Local Time?">
<option value="Anytime">Anytime</option>
<option value="10">10:00</option>
<option value="12">12:00</option>
<option value="14">14:00</option>
<option value="16">16:00</option>
<option value="18">18:00</option>
</item>

<item type="checkbox" name="Methods of Communication" label="Communication" required="1" default="" tip="Please check all methods of communication allowed">
<option value="Telephone">Telephone</option>
<option value="Mobile">Mobile</option>
<option value="E-mail">E-mail</option>
<option value="Post">Post</option>
</item>

<item type="select" name="How did you find us" label="How did you find us?" default="" tip="">
<option value="Unanswered" selected="selected">Unanswered</option>
<option value="Search">Search engine, Google, Bing, etc.</option>
<option value="Another">Another lawyer or Associate</option>
<option value="Friend">Friend of a previous client</option>
<option value="Media">Social Media</option>
</item>

Title: Re: anyform drop down error
Post by: datahell on May 09, 2018, 14:59:52
All of them are wrong.

Attribute name cannot contain spaces or special symbols. name is the internal name of the element, not visible to user and should be unique. Proper names: "besttimetocall", "communication", "howfindus"

 selected="selected" is wrong. The default selected element is set with the default attribute.
<item type="select" name="howfindus" label="How did you find us\?" default="Unanswered" tip="">
   <option value="Unanswered">Unanswered</option>
   <option value="Search">Search engine, Google, Bing, etc.</option>
   <option value="Another">Another lawyer or Associate</option>
   <option value="Friend">Friend of a previous client</option>
   <option value="Media">Social Media</option>
</item>

Remove required attribute from checkbox

Special characters (except a few) cannot be used in XML documents except if you add them in CDATA blocks. However CDATA blocks cannot be used inside attributes. The question mark inside tip attribute can create problems. You can try escape it \? or use &#63; instead of it.
Title: Re: anyform drop down error
Post by: xmanhattan on May 09, 2018, 17:10:04
Hello datahell,

When we talk about special characters, do Greek characters constitute special characters?
I ask because of the accent marks.

example:
Code: [Select]
<item type="select" name="Πώς μας βρήκατε" label="Πώς μας βρήκατε;" default="Αναπάντητος" tip="">
<option value="Αναπάντητος">Αναπάντητος</option>
<option value="Αναζήτησης">Μηχανή αναζήτησης, Google, Bing, κλπ.</option>
<option value="Άλλος">Άλλος δικηγόρος ή συνεργάτης</option>
<option value="Φίλος">Φίλος ενός προηγούμενου πελάτη</option>
<option value="Κοινωνικής">Κοινωνικής δικτύωσης</option>
</item>

Thank you for your previous answer and quick reply.
Title: Re: anyform drop down error
Post by: datahell on May 09, 2018, 18:51:30
All letters (of any language) and digits are valid characters. The "name" in the sample you posted is still wrong:

<item type="select" name="Πώς μας βρήκατε" label="Πώς μας βρήκατε;" default="Αναπάντητος" tip="">

Correct one:
<item type="select" name="howfind" label="Πώς μας βρήκατε;" default="Αναπάντητος" tip="">
Title: Re: anyform drop down error
Post by: xmanhattan on May 10, 2018, 08:58:54
Okay, thank you datahell