[英]one text box with tow option different in value
I have a form contain a textbox with tow option, one of the options is to write a just letter and the other option is to write a number, how can separate them?我有一个表单包含一个带有拖曳选项的文本框,其中一个选项是写一个简单的字母,另一个选项是写一个数字,如何将它们分开?
when the user selected journal name it should write just a letter and when select ISSN it will enter a just number? when the user selected journal name it should write just a letter and when select ISSN it will enter a just number? function ValidateTextBox(txt) {
函数验证文本框(txt){
if (txt == "ISSN") {
document.getElementById("searchword").pattern="[0-9]{4}[-]{1}[0-9]{3}[0-9Xx]{1}";
document.getElementById("searchword").placeholder="like: 1111-1111 or 1111-111x";
}
else {
document.getElementById("searchword").pattern="[A-Za-z]{100}";
document.getElementById("searchword").placeholder="International journal of Computers and Technology";
}
} }
Check This http://jsfiddle.net/pjkhpxzx/ When A User Select A Value In Drop Down That Value Will Be Visible In The Text Box检查此http://jsfiddle.net/pjkhpxzx/当用户在下拉列表中选择一个值时,该值将在文本框中可见
This Done By A Simple JQuery这是由一个简单的 JQuery 完成的
Below Is HTML下面是 HTML
<select id="data">
<option value=""></option>
<option value="text">text</option>
<option value="number">number</option>
below is Jquery下面是Jquery
$(document).ready(function(e) {
$("#data").change(function(){
var item = $(this).val();
$("#dataval").attr("type",item)
});});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.