使用Bootstrap和Jquery处理HTML。我需要根据多个无线电点击隐藏div。 (我已经用提交按钮检查了。它工作正常)。但我需要没有提交按钮。这是我的代码,
这里我的代码显示错误。它不检查两个值,它只适用于一个条件。 如何签入多项选择,
<!DOCTYPE html>
<html>
<head>
<title>Radio Button Selection</title>
<script src="libs/jquery-2.1.3/js/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('input[type="radio"]').click(function (e) {
var checked_option_radio = $('input:radio[name=user_options]:checked').val();
var checked_site_radio = $('input:radio[name=user_site]:checked').val();
if(checked_option_radio==='css' || checked_site_radio==='Google')
{
$("#other1").hide();
}
});
});
</script>
</head>
<body>
<form id="myform">
<div>Choose option:
<input type="radio" name="user_options" value="css" /> CSS
<input type="radio" name="user_options" value="jquery" /> jQuery
<input type="radio" name="user_options" value="html" /> HTML
<input type="radio" name="user_options" value="xml" /> XML
</div>
<div>Another option:
<input type="radio" name="user_site" value="Google" /> Google
<input type="radio" name="user_site" value="Yahoo" /> Yahoo
<input type="radio" name="user_site" value="Facebook" /> Facebook
<input type="radio" name="user_site" value="Twitter" /> Twitter
</div>
<div class="row" id="other1">
<textarea class="form-control" rows="4" id="specification" name="specification" placeholder="Enter Specification"></textarea>
</div>
</form>
</body>
</html>
朋友更正我的代码。请提供一些其他示例代码。
答案 0 :(得分:0)
org.mule.api.registry.ServiceException: Failed to load transport: org/mule/transport D
at org.mule.registry.MuleRegistryHelper.createServiceDescriptor(MuleRegistryHelper.java:563)
at org.mule.registry.MuleRegistryHelper.lookupServiceDescriptor(MuleRegistryHelper.java:537)
at org.mule.endpoint.DefaultEndpointFactory.getEndpointBuilder(DefaultEndpointFactory.java:125)
at org.mule.endpoint.SimpleEndpointCache.getOutboundEndpoint(SimpleEndpointCache.java:45)
at org.mule.client.DefaultLocalMuleClient.send(DefaultLocalMuleClient.java:113)
at org.mule.client.DefaultLocalMuleClient.send(DefaultLocalMuleClient.java:101)
at fileTestCase.sampleTest.testFile(sampleTest.java:59)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
at org.junit.internal.runners.statements.FailOnTimeout$StatementThread.run(FailOnTimeout.java:74)