本文介绍了禁用文本框并选择声明Vise Versa的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 嗨! 我想问一下javascript的用法。因为我对某个字段有两个选项。一个是文本框,另一个是select语句。我希望它们的行为是:如果用户在文本框中输入文本,则选择选项将被禁用,但是当用户从select语句中选择一个值时,文本框和文本框中的文本将被禁用并删除。 />Hi!I want to ask what javascript to use. Because I have two options for a certain field. One is a textbox the other is a select statement. I want the behavior of them to be: If user inputs text in the textbox the select option will be disabled, but when the user selects a value from the select statement the textbox and the text in the textbox will be disabled and removed.<div class="form-group"><label class="control-label col-sm-2">Event Location:</label><div class="col-sm-4"> <?phpIf (!isset($_SESSION['EventLoc'])){?><input id="freetxt" type="text" name="LocOfEvent" class="form-control" size="48" value="<?php echo isset($_POST["LocOfEvent"]) ? $_POST["LocOfEvent"] : '';?>"/><?php}else{?><input id="freetxt" type="text" name="LocOfEvent" class="form-control" size="48" value="<?php echo $_SESSION['EventLoc'];?>"/><?php}if (isset($_POST['CheckOut']) || isset($_POST['ScanItem']) || isset($_POST['BrowseItem'])){if($_POST['batchEvent'] == ""){echo "<font color='red'>*Location is Empty</font>";$error= true;$msg .= "Location is Empty\\n";}}?></div><label class="col-sm-1" align="center">-or-</label><div class="col-sm-5"><select id="options" class='form-control'><option value=''>Select Location</option><option value='1'>This is a test</option></select></div></div>推荐答案 这篇关于禁用文本框并选择声明Vise Versa的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
05-28 04:51
查看更多