聚合物+形成POST数据 [英] Polymer + form POST data

查看:193
本文介绍了聚合物+形成POST数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个

 < form id =form_837299class =appnitromethod =postaction = insert.php > <纸张输入标签=标题名称=标题maxlength =255> 
< / paper-input>


< li class =buttons>

< input type =hiddenname =form_idvalue =837299/>
< input id =saveFormclass =button_texttype =submitname =submitvalue =Submit/>
< / li>
< / ul>
< / form>

我的POST数据有问题 - 在text和title中没有任何内容纸质输入)。

我修改了模板和属性name现在是在一个div中,即Polymer创建的。但没有数据发送。



print_r($ _ POST);只显示我:
Array([form_id] => 837299 [submit] =>提交)

任何人都知道如何在表单上使用Polymer和Material UI ?

解决方案

只有扩展了本地表单元素的元素才会自动使用表单提交。 文件输入扩展核心输入,其中有一个输入,而不是扩展它。请参阅此邮件列表讨论进行其他讨论并此StackOverflow帖子寻找可能的解决方案。



这个jsbin 也许?



更新 web组件表单


$ b 更新:看起来像 ajax-form has 添加了此功能。



更新:也是consid呃使用 iron-form


I have this

<form id="form_837299" class="appnitro"  method="post" action="insert.php"> <paper-input label="Title" name="title" maxlength="255">
            </paper-input>
          <paper-input floatinglabel multiline label="text" name="text"></paper-input>                           


          <li class="buttons">                                       

            <input type="hidden" name="form_id" value="837299" />                                                        
            <input id="saveForm" class="button_text" type="submit" name="submit" value="Submit" />                           
          </li>                          
        </ul>                    
      </form>

I have problem with POST data - nothing is sended in "text" and "title" (all in paper-input).

I modified the template and attribute "name" now is in one div, which Polymer created. But no data are sent.

print_r($_POST); shows me only this: Array ( [form_id] => 837299 [submit] => Submit )

Anybody knows how use Polymer and Material UI on form?

解决方案

Only elements that extend native form elements automatically get submitted with forms. paper-input extends core-input which has an input inside it as opposed to extending it. See this mailing list discussion for additional discussion and this StackOverflow post for possible solutions.

Something like this jsbin maybe?

Update: Here's the same thing in web component form.

Update: Looks like the creator of ajax-form has added this functionality.

Update: Also consider using iron-form.

这篇关于聚合物+形成POST数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆