doushi6932 2015-08-04 19:48
浏览 18

日期输入未发送到Parse(适用于除Chrome以外的所有浏览器)

First I take the input in as:

<input id="orderTimeOne" name="orderTimeOne" type="time" value=<?php if(isset($_SESSION['orderTimeOne'])) { echo '"' . $_SESSION['orderTimeOne']='' . '"';} ?>>

So the id is orderTimeOne and the type is time

----------------Then on the next page:--------------------

if statement containing passed variables from session

if ($_SERVER["REQUEST_METHOD"] == "POST") {
    $_SESSION['orderTimeOne'] = $_POST['orderTimeOne'];
}   

if($_SESSION['orderTimeOne'] == '' || !isset($_SESSION['orderTimeOne']))
{
    $timeOne=0;
} else {
    $timeOne=1;
}

----------------Then on the next page:--------------------

<?php
    $orderTimeOne = $_SESSION['orderTimeOne'];
?>


<p id="FirstTime" style="text-align: right;"><?php echo $orderTimeOne;?> </p>

This echo's out the input of the date the user put from the starting page. Now this is the final page before the user presses confirm and it calls upon a onclick JS function. Which does this all in one function:

function() {
    var Booking = Parse.Object.extend("Booking");
    var firstOrderTime = document.getElementById('FirstTime').innerHTML;

    booking.save ({
        firstOrderTime: firstOrderTime
    });
}

firstOrderTime is the variable string set in Parse

Keep in mind this all works in Safari as well and FireFox, just not Chrome.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥20 机器学习能否像多层线性模型一样处理嵌套数据
    • ¥20 西门子S7-Graph,S7-300,梯形图
    • ¥50 用易语言http 访问不了网页
    • ¥50 safari浏览器fetch提交数据后数据丢失问题
    • ¥15 matlab不知道怎么改,求解答!!
    • ¥15 永磁直线电机的电流环pi调不出来
    • ¥15 用stata实现聚类的代码
    • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
    • ¥20 docker里部署springboot项目,访问不到扬声器
    • ¥15 netty整合springboot之后自动重连失效