我的 asp.net mvc Web 应用程序中有以下代码:-
@using (Ajax.BeginForm("AdvanceSearchIndex","Home",
new AjaxOptions
{
HttpMethod = "get",
InsertionMode = InsertionMode.Replace,
LoadingElementId = "progress",
UpdateTargetId = "SearchTable"
}))
{
<p><span class="f">IP Address <input placeholder="Search by IP " name="ip" type="text" /> </span></p>
<p><span class="f">MAC Address <input placeholder="Search by Mac " name="mac" type="text" /> </span></p>
<input class="btn btn-success" type="submit" value="search" />
<img src="~/Content/Ajax-loader-bar.gif" class="loadingimage" id="progress" />
}
但我需要编写一个 javaScript 代码,以便在单击“搜索”按钮时 IP 地址或 MAC 地址不为空或为空?