This is solution can be used for a specific use case where the users inputs character with diacritical marks in them and you would like to remove or "normalize" those characters. This solution can be useful to have more user-friendly search criteria.
What you would need to do is to put a header & footer on your submission page and put the following code in the footer. Don't forget to disable the HTML editor on the Advanced tab before pasting the code below.
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.
Question
Wikiwi
This is solution can be used for a specific use case where the users inputs character with diacritical marks in them and you would like to remove or "normalize" those characters. This solution can be useful to have more user-friendly search criteria.
What you would need to do is to put a header & footer on your submission page and put the following code in the footer. Don't forget to disable the HTML editor on the Advanced tab before pasting the code below.
Script:
<script>
document.getElementsByName('Submit')[0].unsafe = function(){
//first_name
var str = document.getElementById('InsertRecordFIELD_NAME').value;
document.getElementById('InsertRecordFirst_Name').value = str.normalize("NFD").replace(/[\u0300-\u036f]/g, "");
//last_name
var str = document.getElementById('InsertRecordFIELD_NAME').value;
document.getElementById('InsertRecordLast_Name').value = str.normalize("NFD").replace(/[\u0300-\u036f]/g, "");
}
</script>
The code will run when the user hovers their mouse on the submit button. See the screenshots below for reference.
Before hovering the mouse: https://aucdn.caspio.com/D4B16000/Screenshot/Screenshot_1_9.png
After: https://aucdn.caspio.com/D4B16000/Screenshot/Screenshot_2_10.png
Link to comment
Share on other sites
1 answer to this question
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.