简体   繁体   English

获取所选日期的值并导航到下一个URL

[英]Get Value Of Selected Date And Navigate To Next URL

How can I get the value of the calendar date selected, once selected it should navigate to a php page where I use the value of selected date in the php page to run the query, so far the date selected only displays in the textfield. 如何获取选定的日历日期的值,一旦选定该日期,它应该导航到一个php页面,在该页面中我使用php页面中的选定日期的值来运行查询,到目前为止,选定的日期仅显示在文本字段中。

eg: 例如:

  1. PHP page - date selected is 2015-08-11 PHP页面-选择的日期是2015-08-11
  2. Open up URL to another PHP (in same tab) 打开另一个PHP的URL(在同一选项卡中)
  3. Use date selected for query ($selected_date = $_GET["DATE"]) 使用查询选择的日期($ selected_date = $ _GET [“ DATE”])

This is the calendar view code: 这是日历视图代码:

      function setupCalendars() {
    // Embedded Calendar
    Calendar.setup(
      {
        dateField: 'embeddedDateField',
        parentElement: 'embeddedCalendar'
      }
    )

    // Popup Calendar

  }

  Event.observe(window, 'load', function() { setupCalendars() })
</script>

<div style="float: center; width: 50%">

    <div id="embeddedExample" style="">
        <div id="embeddedCalendar">
              </div>
              <br />
                  <div id="embeddedDateField" class="dateField">
                    Selected Date...
                  </div>
              <br />
            </div>
         </div>
    </div>
</div>

it is embedded in the another file (date is selected from this file) 它嵌入在另一个文件中(从该文件中选择了日期)

                <li><a href="#home" class="anchorLink"><i class="icon-calendar scolor"></i> Date </a>

                                <object type="text/html" data="http://<website>/calendarview.html"
                                        style="width:200%; height:310px; margin-right:50%">
                                </object>
            </li>

To do that you're going to have to get the selected date from the child page (is it an iFrame?) and send its value to a field in the parent form when the date is selected. 为此,您将必须从子页面(是iFrame?)中获取选定的日期,并在选择日期后将其值发送到父表单中的字段。 There are a number of ways to do this; 有很多方法可以做到这一点。 you may want to try using the .contents() method located here . 您可能想尝试使用位于此处.contents()方法。 There's a sample provided that traverses links in an iframe. 提供了一个示例,该示例遍历iframe中的链接。 You should be able to do the same with the textbox. 您应该能够对文本框执行相同的操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM