某些表单复选框组合不起作用
我有这段代码,但无法弄清楚问题所在:如果我选择 1 & 2, 1 & 2, 1 & 3 它正在工作。 但如果我只选择 2 或 3,那么它就不起作用。 似乎有什么问题? 我想同时选择多个。
我想我需要在这里放一些 if 和 else 吗? 但真的不知道并且确定如何?
这是代码:
<div style="background-color:#CCDFED">
<form method="post" action="[~[*id*]~]">
<input type="hidden" name="formid" value="registrationForm" />
<table>
<tr>
<td>
<label for="termine" style="margin:0.5em">Termine:</label>
<td>
<td>
<input type="checkbox" name="termine1" value="Montag 4. Oktober 2010" eform="Termine::1"/>	Montag 4. Oktober 2010 <br/>
<input type="checkbox" name="termine2" value="Mittwoch 13. Oktober 2010" />	Mittwoch 13. Oktober 2010 <br/>
<input type="checkbox" name="termine3" value="Freitag 22. Oktober 2010" />	Freitag 22. Oktober 2010 <br/>
</td>
</tr>
<tr>
<td><label for="email" style="margin:0.5em">Email:</label></td>
<td><input type="text" name="email" size="60" maxlength="60" eform="Email:email:1" /><td>
</tr>
<tr>
<td>
<label style="margin:0.5em; display:block" for="kopieren" >Bitte kopieren Sie den Anti-Spam Code ein: </label>
<img src="[+verimageurl+]" alt="verification code" border="1" style="margin:0.5em"/></td>
</td>
<td valign="top"><input type="text" name="vericode" size="20" /> </td>
</tr>
<tr>
<td rowspan="3" valign="right">
<input align="right" type="submit" name="submit" style="margin:0.5em" value="Register" />
</td>
</tr>
</table>
</form>
</div>
I have this code and can't figure out what seems to be the problem: if i select 1 & 2, 1 & 3 it's working.
But if I select 2 or 3 only then it's not working.
What seems to be the problem?
I would like to select multiple at the same time.
i think I need to put some if and else here?
But don't really know and sure how?
This is the code:
<div style="background-color:#CCDFED">
<form method="post" action="[~[*id*]~]">
<input type="hidden" name="formid" value="registrationForm" />
<table>
<tr>
<td>
<label for="termine" style="margin:0.5em">Termine:</label>
<td>
<td>
<input type="checkbox" name="termine1" value="Montag 4. Oktober 2010" eform="Termine::1"/> Montag 4. Oktober 2010 <br/>
<input type="checkbox" name="termine2" value="Mittwoch 13. Oktober 2010" /> Mittwoch 13. Oktober 2010 <br/>
<input type="checkbox" name="termine3" value="Freitag 22. Oktober 2010" /> Freitag 22. Oktober 2010 <br/>
</td>
</tr>
<tr>
<td><label for="email" style="margin:0.5em">Email:</label></td>
<td><input type="text" name="email" size="60" maxlength="60" eform="Email:email:1" /><td>
</tr>
<tr>
<td>
<label style="margin:0.5em; display:block" for="kopieren" >Bitte kopieren Sie den Anti-Spam Code ein: </label>
<img src="[+verimageurl+]" alt="verification code" border="1" style="margin:0.5em"/></td>
</td>
<td valign="top"><input type="text" name="vericode" size="20" /> </td>
</tr>
<tr>
<td rowspan="3" valign="right">
<input align="right" type="submit" name="submit" style="margin:0.5em" value="Register" />
</td>
</tr>
</table>
</form>
</div>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以通过对所有这些设置 eform 来使它们成为必需的。如果不需要,请删除 ::1 eform。我还添加了一条验证消息。
尝试:
我正在盲目地做这一切,所以请耐心等待。提交表单后,您现在需要我不再看到您的确认页面代码。您需要更改的只是在您需要使用的报告中
You are making them required by setting eform on all of them. Remove the ::1 eform if they are not required. I also added a validation message.
Try:
I am doing all of this blindly, so bear with me. Once you have submitted the form, you now need I no longer see your code for the confirmation page. All you need to change is in your report you need to use
这可能是因为标签未附加在您的复选框上,只需向复选框提供 ID,请参阅下面
希望这能解决您的问题。
This might because of label is not attaching with your, checkbox, just provide Id to checkbox, please refer below
Hope this will resolve your issue.