Cameron Posted November 9, 2015 Report Share Posted November 9, 2015 Hi everyone, I have a table with Spain texts, that contains Spain characters (for example, "ñ"). Is it possible to allow users to filter by Spain characters and by English too? I mean, if a user looks for word "dona", the user can enter "doña" or "dona". Now only first case is displayed. Is it possible to display results in both cases? Maybe with some additional criteria? Thank you for your time! Quote Link to comment Share on other sites More sharing options...
Jan Posted November 9, 2015 Report Share Posted November 9, 2015 Hello Cameron, You can follow the following steps (it is not an easy solution, but I do not know a better one): Add a field to your table, name it, for example, "latin_text". Here text without Spain characters will be stored. Edit your Submission Form, add a Header&Footer element, select the Footer element, click the "Source" button and enter the following code: <SCRIPT LANGUAGE="JavaScript"> function latin_text() { var original_field = "original_text"; var latin_field = "latin_text"; original_field = "InsertRecord" + original_field; latin_field = "InsertRecord" + latin_field; var latin_text = document.getElementById(original_field).value; latin_text = latin_text.replace(/á/g, "a"); latin_text = latin_text.replace(/é/g, "e"); latin_text = latin_text.replace(/Ã/g, "i"); latin_text = latin_text.replace(/ó/g, "o"); latin_text = latin_text.replace(/ú/g, "u"); latin_text = latin_text.replace(/ü/g, "u"); latin_text = latin_text.replace(/ñ/g, "n"); latin_text = latin_text.replace(/Ã/g, "A"); latin_text = latin_text.replace(/É/g, "E"); latin_text = latin_text.replace(/Ã/g, "I"); latin_text = latin_text.replace(/Ó/g, "O"); latin_text = latin_text.replace(/Ú/g, "U"); latin_text = latin_text.replace(/Ãœ/g, "U"); latin_text = latin_text.replace(/Ñ/g, "N"); document.getElementById(latin_field).value = latin_text; } document.getElementById("caspioform").onsubmit=latin_text; </SCRIPT> Please, enter the name of your current field instead of "original_text" and the name of a new field instead of "latin_text". Now, when a user enters a text, a copy of the text without Spain characters is added to the "latin_text" field. Edit your Report DataPage, open the "Configure Search Fields" screen, add the "latin_text" field, and set the Hidden Form Element for the field; open the Logic tab and change the group "AND" to "OR". On the screen, add a Header&Footer element, select the Footer element, click the "Source" button and enter the following code: <SCRIPT LANGUAGE="JavaScript"> function look_for() { document.getElementById("Value2_1").value = document.getElementById("Value1_1").value; } document.getElementById("caspioform").onsubmit=look_for; </SCRIPT> In my screen, the "original_text" is the first field, so I used "Value1_1". The "latin_text" is the second field, and I used "Value2_1" for it. Please, enter the order numbers of your fields instead of 1 and 2, if they are different. Now, when a user enters a criteria, the text is copied to the second criteria and the text is searched in both Spain and English versions of the texts. I hope, it helps. Quote Link to comment Share on other sites More sharing options...
JamesSmith12 Posted November 16, 2015 Report Share Posted November 16, 2015 Thank you so much for the valuable information. Quote Link to comment Share on other sites More sharing options...
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.
Note: Your post will require moderator approval before it will be visible.