0

Hello

in the registration form of my WordPress based website, i need when user clicks on any field (for example username field), the cursor be automatically placed at left end in that field & the keyboard be automatically on ENG-US.

I need this because some of my users have right to left language and perhaps their keyboard is set to right-to-left language when they open registration page & so when they click on any field, the cursor would be placed on the right end in the field (which is undesirable & the user must manually press Ctrl+shift to make cursor be located at the left of the field.)

I want to know whether the above is possible (forcing cursor to be automatically placed at the left end of the field and language be set to ENG-US)? I don't know what code should I use and in which file on my WordPress site.

nmm4829
  • 15
  • 6
  • do you have any code – Akhil Aravind Jun 06 '18 at 12:17
  • Can you post your code please? This makes it easier to help you. You will probably have to use "Locale" to identify whether the user's language is written from left to right or right to left. – Denis Jr Jun 06 '18 at 12:18
  • Possible duplicate of [Set keyboard caret position in html textbox](https://stackoverflow.com/questions/512528/set-keyboard-caret-position-in-html-textbox) – Shilly Jun 06 '18 at 12:21
  • no i don't have any code and i asked for the code. thanks Shilly i 'll study that link, but i don't know in which file in my WordPress website i must enter that code. – nmm4829 Jun 06 '18 at 12:26

1 Answers1

0

You can use the dir="rtl" on the input.

<input dir="rtl" id="foo"/>

or by css

#foo{
  direction: rtl;  /* Right to Left */
}

but if you want to do for some countries , you need to check by location with the help of GEO location or google location.

Vaibhav Kumar
  • 768
  • 4
  • 12
  • thanks a lot. above css code made cursor be placed at left end of all fields, but didn't changes they keyboard input language to ENG-US. is that possible as well ? – nmm4829 Jun 06 '18 at 13:16
  • share your link – Vaibhav Kumar Jun 06 '18 at 13:22
  • that's an internal website inside organization. is WordPress based and indeed membership pro plugin provides registration and login forms – nmm4829 Jun 06 '18 at 13:29
  • check this link https://stackoverflow.com/questions/7741280/change-html-language-from-en-us-in-to-en-gb-in-wordpress/37571439#37571439 – Vaibhav Kumar Jun 06 '18 at 13:43
  • i tried those workarounds but none of them forced keyboard input language automatically be changed to en-US when we click into input fields of registration form fields. – nmm4829 Jun 06 '18 at 14:58