How does one get a nested form id while using jquery?
lets say the form is
<form id="search-theme-form">
<div id = "search">
<div id="edit-search-theme-form-1-wrapper" class="form-item">
</div>
<input id="edit-submit" class="form-submit btn">
</div>
</form>
will it be
$('#search-theme-form').submit(function () {
$('#search #edit-submit').click(function () {
if ($("#search input:text").val() == "Search this community..." || $("#search input:text").val() == "") {
alert("Please enter a search term");
return false;
}
});
});
$("$edit-submit").click()should be$("#edit-submit").click()#search input:textto work you’ll have to specifytype="text"on your<input>.