我创建了以下内容,但由于该值具有管道符,因此无效。当我移除管道时,它正常运行。我尝试逃避但是没有用。有什么想法吗?
我在Contact Form 7插件中的HTML代码
<p>Your Name (required)<br />
[text* your-name] </p>
<p>Your Email (required)<br />
[email* your-email] </p>
<label for="recipient">Choose your interest</label>
[select* recipient id:recipient include_blank
"events|events@example.com"
"custom orders|customorders@example.com"]
<div class="hide" id="hide1">
<label for="event-type">Type of Event</label>[text event-type /50 id:event-type]
</div>
<p>Your Message<br />
[textarea your-message] </p>
<p>[submit "Send"]</p>
我的jQuery脚本:
$(document).ready(function() {
//Hide the field initially
$("#hide1").hide();
//Show the text field only when the third option is chosen - this doesn't
$('#recipient').change(function() {
if ($("#recipient").val() == "events|events@example.com") {
$("#hide1").show();
}
else {
$("#hide1").hide();
}
});
});