提交带有临时链接的按钮
好。 我不知道我在做什么。 我要回去帮助人们找工作。 我在小提琴中运行了所有内容并将其迁移到两个不同的编辑器,所有内容都显示正常,但没有任何反应,没有警报,也没有提交的onclick。 我在笔记本电脑上试了一下,两个页面上显示了一个有profilebannerIE,另一个带有html。 再次感谢。
老人新到jquery。 我们有一个表格,我们希望人们填写并提交。 forms并不难创造,但现在我们希望它做一些特殊的事情。 我已经研究并尝试了3天不同的事情,这是我最后的努力。 你的许多论坛想法非常聪明,我相信你可以让它一闪而过。 提前致谢!
如果七个或更多单选按钮被单击“是”,我们将尝试获取以下表单上的提交按钮以转到“网站1”。 如果答案少于7个“是”,我们希望它转到“网站2”。
Survey Survey
Please answer the following questions and click the 'Submit' button at the bottom of the page.
仅供将来参考,有一个名为jsFiddle的漂亮工具,您可以使用它来为我们提供更好的代码: jsFiddle
我已经为你做了一个快速的解决方案,应该让你从这里开始
var answered_yes = 0; $("input[type=radio]:checked").each(function() { if ($(this).val() === "Yes") { answered_yes++; } }); if (answered_yes >= 7) { location.href = "7 or more website.html"; } else { location.href = "less than 7 website.html"; }
完整标记
这是你可以使用的标记(从CDN中包含jQuery库),你的标记需要相当多的工作,但你已经明确表示你是一个初学者所以我会给你一个骨头。 看看你是否能够进一步了解这一点。
Survey Survey
Please answer the following questions and click the 'Submit' button at the bottom of the page.
你可以尝试以下代码来获取已检查单选按钮的计数,其示例代码
HTML
jQuery的
$('#test').click(function(){ if($(':radio[name=rdQueen]:checked, :radio[name=rdFruit]:checked').length == 2) alert('good to go'); else alert('please choose one from each group'); });