【发布时间】:2017-06-14 21:15:09
【问题描述】:
我试图让优先级下拉菜单在用户选择选项时动态更改另一个下拉菜单的值。我正在使用 Jquery Mobile,但不确定如何实现这一点。这是我目前的 HTML。因此,如果我选择优先级正常,我会喜欢它,所以在 commETA 和 compETA 选择框中选择 48 小时。提前感谢您的帮助!
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Login</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Bootstrap -->
<link rel="stylesheet" href="../css/themes/Estimates.css" />
<link rel="stylesheet" href="../css/themes/jquery.mobile.icons.min.css" />
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile.structure-1.4.5.min.css" />
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
</head>
<body>
<div data-role="page" data-theme="a">
<div data-role="header" data-position="inline">
<h1>MGK Electric CTA</h1>
</div>
<div data-role="content" data-theme="a">
<form class="form-signin" id="form1" method="post" action="<?php echo $formaction; ?>">
<h4 class="form-signin-heading" style="text-align: center;">Please describe CTA Below</h4>
<label style="font-weight: bold;">Customer Name:</label>
<input name="Customer_Name" id="Customer_Name" type="text" class="form-control" autofocus required="required"><br />
<label style="font-weight: bold;">Priority Level:</label>
<select name="Priority" id="Priority" required="required">
<option value="">Please Select</option>
<option value="Normal">Normal</option>
<option value="High">High</option>
<option value="Severe">Severe</option>
<option value="Emergency">Emergency</option>
</select><br />
<label style="font-weight: bold;">Project:</label>
<input name="Project" id="Project" type="text" class="form-control"><br />
<label style="font-weight: bold;">Expected Time for Communication:</label>
<select name="commETA" id="commETA" required="required">
<option value="">Please Select</option>
<option value="Today">Today</option>
<option value="48 Hours">48 Hours</option>
<option value="1 Week">1 Week</option>
<option value="2 Weeks">2 Weeks</option>
</select><br />
<label style="font-weight: bold;">Expected Time for Completion:</label>
<select name="compETA" id="compETA" required="required">
<option value="">Please Select</option>
<option value="Today">Today</option>
<option value="48 Hours">48 Hours</option>
<option value="1 Week">1 Week</option>
<option value="2 Weeks">2 Weeks</option>
<option value="1 Month">1 Month</option>
<option value="Unknown">Unknown</option>
</select><br />
<label style="font-weight: bold;">Description of Issue:</label>
<textarea name="issue" id="issue" required="required"></textarea><br />
<label style="font-weight: bold;">Unknowns About Issue:</label>
<textarea name="unknowns" id="unknowns" required="required"></textarea><br />
<label style="font-weight: bold;">People Invoved in CTA:</label>
<textarea name="people" id="people" required="required"></textarea>
<br /><br />
<input type="hidden" name="doform" value="doform">
<button name="Submit" id="submit" class="btn btn-lg btn-primary btn-block" type="submit">Sign in</button>
<div id="message"></div>
</form>
</div>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script type="text/javascript" src="login/js/bootstrap.js"></script>
</body>
</html>
【问题讨论】:
标签: jquery jquery-mobile