Welcome Guest, Not a member yet? Register   Sign In
Force ASCII
#1

[eluser]txomin[/eluser]
Not a CI question but please indulge me.

I'm developing a CI application for a Japanese school. They want everything in English and also want students to use "direct input", that is, ASCII. However, there is concern that some students might forget to do so and they want me to force them to do so via the code (as non-unicode desktop apps force ascii input on user). So, is it possible to create text fields, forms, etc that force ASCII input?

Thank you all in advance.
#2

[eluser]rogierb[/eluser]
You can with a regex in javascript. Or a regex form valididation using the form validation library.


Maybe something like "[^\x20-\x7E]"
#3

[eluser]txomin[/eluser]
Yeah. That makes sense. I wonder, though, if it would be possible via HTML, perhaps by assigning a certain non-unicode font...
#4

[eluser]rogierb[/eluser]
That would only work if the OS has that font installed. And even then it would be tricky.
#5

[eluser]txomin[/eluser]
... which is unlikely to be the case in a Japanese machine. You are right. The way to go is javascript. I can alert the user every time they go outside ASCII. Good enough (I hope).

Thanks for taking the time to help me out.




Theme © iAndrew 2016 - Forum software by © MyBB