简体   繁体   English

更改焦点上文本框的输入字体语言

[英]change the input font language of text box on focus

I have two text boxes to enter the name of the customer.我有两个文本框来输入客户的姓名。 In one text box I need to enter the name of the customer in English language and on another text box need to enter the name in hindi language.在一个文本框中,我需要用英语输入客户的姓名,在另一个文本框中需要用印地语输入姓名。 One way to do this is to change the computer language using Alt Shift key but it is tedious job for the user to change the font every time to move on to the text boxes.一种方法是使用Alt Shift键更改计算机语言,但用户每次更改字体以移动到文本框是一项繁琐的工作。

Is there any way to change the font language using CSS and javascript as the user focuses on the text boxes.当用户专注于文本框时,有什么方法可以使用 CSS 和 javascript 更改字体语言。 So is there any way to change the font language and the user moves to the text boxes.那么有什么方法可以更改字体语言并且用户移动到文本框。

<div class="form-group">
    <label>Name: </label><span class="required">*</span>
    <input type="text" required="required" class="form-control" maxlength="200" runat="server" id="txtEngName" autocomplete="off" />
</div>

<div class="form-group">
    <label>नाम: </label><span class="required">*</span>
    <input type="text" required="required" class="form-control" maxlength="200" runat="server" id="txtHindiName" autocomplete="off" />
</div>

Use lang attribute and font family attribute for particular element对特定元素使用 lang 属性和字体系列属性

#hindi{
font-family:your font;
lang: language;
}

try like below尝试如下

<input type="textbox" name="text1" Lang="HI-IR" /> 

You can view list lang您可以查看列表语言

https://www.w3schools.com/tags/ref_language_codes.asp https://www.w3schools.com/tags/ref_language_codes.asp

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM