【发布时间】:2012-03-15 12:43:35
【问题描述】:
我想使用 jquery 而不是内联来实现它,但它不起作用,内联工作正常。我想使用 jquery 的另一个原因是,如果用户选择了多个复选框,则 url 应该附加任何已经存在的内容 + OR '2nd CheckBox Value',如下所示: “http://mysite/sites/dev/contact-us/Pages/LocationSearchTestPage.aspx?s=bcs_locations&k=办公室或医院” 前面和后面的空间或者很好.. 我怎样才能做到这一点?有人可以帮帮我吗?
Offices<input name="LocType" type="checkbox"
value="Office" onclick="window.location='http://mysite/sites/dev/contact-us/Pages/LocationSearchTestPage.aspx?s=bcs_locations&k=Office'; return true;">  
Hospitals<input name="LocType" type="checkbox"
value="Hospital" onclick="window.location='http://mysite/sites/dev/contact-us/Pages/LocationSearchTestPage.aspx?s=bcs_locations&k=Hospital'; return true;">  
Facilities<input name="LocType" type="checkbox"
value="Facility" onclick="window.location='http://mysite/sites/dev/contact-us/Pages/LocationSearchTestPage.aspx?s=bcs_locations&k=Facility'; return true;">
【问题讨论】:
-
你已经发了more or less the same question,有人不厌其烦地回答,然后有两个人回答了your other question。
标签: javascript jquery checkbox onclick query-string