将php表单保存到javascript var对象数组

时间:2016-09-28 14:02:00

标签: javascript php

我是javascript和php的新手。我正在开发一个项目,我已经从下面的js文件中提取数据。



var arrApps = {apps: [  
    {"id": "1",
     "app": "Happy Horse", 
     "url": "www.happyhorse.com",
     "owner": "",
     "queue": "someone else",
     "notes": ""},
    
    {"id": "2",
     "app": "Lucky Horse", 
     "url": "",
     "owner": "",
     "queue": "Yours",
     "notes": ""}
]};




我有一个表格,代码如下:



<form method="post" action="">

            <label for="appName">Application Name: <span class="required">*</span> </label>
            <br>
            <input type="text" id="appName" name="appName" value="" placeholder="Application Name" required="required" >
            <br>
            <label for="url">URL:</label>
            <br>
            <input type="text" id="url" name="url" value="" placeholder="Enter Application URL">
            <br>
            <label for="notes">Notes:</label>
            <br>
            <textarea id="notes" name="notes" placeholder="Anything else important about application" required=""></textarea>
            <br>
            <input type="submit" value="Submit" id="btnSubmitArray">

        </form>
&#13;
&#13;
&#13;

我正在尝试使用php来获取表单数据并保存到javascript文件中。它没有像json文件那样完全设置,所以我一直在遇到问题。有人有什么想法吗?

0 个答案:

没有答案