如果表单提交为空,则日期选择器无法在下一页上运行

时间:2019-06-24 06:43:20

标签: php jquery

我正在使用jQuery datepicker从数据库中筛选搜索结果。索引页面中有一个搜索表单(search.php中也有相同表单),它在插入输入并在search.php页面中显示数据表后将用户定向到search.php页面。在正常情况下,日期选择器工作正常,但是当我对index.php中的表格进行汇总时,不会在search.php中触发日期选择器。

这是index.php中的表格

class yourViewController: UIViewController,MFMailComposeViewControllerDelegate {
}

 override func viewDidLoad() {
let mailComposeViewController = configuredMailComposeViewController()
        if MFMailComposeViewController.canSendMail() {
            self.present(mailComposeViewController, animated: true, completion: nil)
        } else {
            self.showSendMailErrorAlert()
        }
}


func configuredMailComposeViewController() -> MFMailComposeViewController {
        let mailComposerVC = MFMailComposeViewController()
        mailComposerVC.mailComposeDelegate = self // Extremely important to set the --mailComposeDelegate-- property, NOT the --delegate-- property

        mailComposerVC.setToRecipients(["your mail"])
        mailComposerVC.setSubject("Yoursubject")
        mailComposerVC.setMessageBody("", isHTML: false)

        return mailComposerVC
    }

    func showSendMailErrorAlert() {
        let sendMailErrorAlert = UIAlertView(title: "Could Not Send Email", message: "Your device could not send e-mail.  Please check e-mail configuration and try again.", delegate: self, cancelButtonTitle: "OK")
        sendMailErrorAlert.show()
    }

    // MARK: MFMailComposeViewControllerDelegate Method
    func mailComposeController(_ controller: MFMailComposeViewController, didFinishWith result: MFMailComposeResult, error: Error?) {
        controller.dismiss(animated: true, completion: nil)
    }

这是search.php中的部分


<section id="searchForm">
 <div class="container">
   <h1>Search</h1>
    <h3>See Proc</h3>
      <form id="form" align="center" action="search.php" method="GET">
    <input class="search_input" type="text" name="from" placeholder="From...">
    <input class="search_input" type="text" name="where" placeholder="Where...">
    <input class="search_input" type="text" id="datepicker" name="date" placeholder="Date...">
    <select id="select" name="type">
    <option value="package">Package</option>
    <option value="paper">Paper</option>
    </select>
    <input class="btn btn-secondary" name="search_btn" type="submit" value="Search">
    </form>
</div>
</section>

<script>
$(document).ready(function() {
  $('#datepicker').datepicker({
  });
});
</script>

0 个答案:

没有答案