Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Polymer + form POST data

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?

like image 456
Vojtech Cerveny Avatar asked Jun 27 '14 22:06

Vojtech Cerveny


Video Answer


1 Answers

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.

like image 149
CletusW Avatar answered Oct 19 '22 17:10

CletusW