Changes

Forms Language Bar

2,068 bytes added, 10:28, 20 August 2015
no edit summary
Now if you click the different buttons you get the following type screen.
[[File:languagebar_003languagebar_004.png|600xpx]]   = Tweaking the script =   Now that you can see how your language bar is going to work, we tweak each of the areas.  == Opening script ==  Move the div around the opening script instead of being after it. <syntaxhighlight lang="html4strict"><div id="strOpening">Good --period--. My name is --firstname--. How can I help?</div><br /></syntaxhighlight>  On the page is a hidden variable called strBEDisplayed_Username.  There is also another one called dteCCL_782_StartDateTime. From the StartDateTime, we can work out the period.   == Questions ==  === Can I ask your name please ===  Move the div around the Question, instead of in the Notes. You'll notice the field headings are in English. Right click on one of them and choose "Inspect Element". This will give you an Id for the td. E.g. our form is 782, so we get. <syntaxhighlight lang="html4strict"><tr> <td width="13%" id="objHeading_strCDA_782_field_0_2">Title</td> <td width="28%" id="objHeading_strCDA_782_field_1_2">Firstname</td> <td width="13%" id="objHeading_strCDA_782_field_2_2">Initial</td> <td width="28%" id="objHeading_strCDA_782_field_3_2">Surname</td></tr></syntaxhighlight> In our JavaScript we add language translation for each of these items as well. Do exactly the same thing with the "Find Similar" button, which turns out to be btnFind_SimilarstrCDA_782_field_1_2   === Can I get a phone number please? ===  Simply move the div into the Question   === What is your favourite colour? ===  Again move the div into the Question. However as this is a drop down list we want the values to appear to the user in their native language, but the data in the background to be stored in English for consistency.  Find the ID of the question, which in this case is strCDA_782_field_0_7. You do this by editing the question and at the top of the screen it will let you know what the element Id is.  For each item, we wipe the drop down list and put back in the options in the appropriate language. You can see below how this is done.  == Putting it together ==  
7,528
edits