2

I'm working on a forum theme and started using web components but the form elements don't work.

I have stuff like this:

<input type="text" name="subject" maxlength="85" value="{$subject}" tabindex="1" />

and I tried translating it like that

<paper-input floatinglabel="" label="{$lang->thread_subject}" type="text" name="subject" maxlength="85" value="{$subject}" tabindex="1"></paper-input>

and all kind of variations also nesting the element inside but it doesn't work.

Same goes for all other input elements like submit buttons, checkboxes etc.

ebidel
  • 23,921
  • 3
  • 63
  • 76
maniacmusic
  • 67
  • 1
  • 7
  • Can you be more specific what doesn't work, or what errors you're getting? – ebidel Aug 06 '14 at 12:46
  • Well, the form doesn't work. The first line (normal ) works just fine, the renders correctly and seems to do everything what it supposed to do but it doesn't do the form input so in this case it would say "You didn't enter a subject". No paper-inputs work, I must be doing something wrong. – maniacmusic Aug 06 '14 at 13:27
  • See http://stackoverflow.com/questions/24461460/polymer-form-post-data – ebidel Aug 06 '14 at 13:54
  • I saw this before but I don't really get it. I have to write a bunch of JS or what ? Just to do this simple thing ? And how to do submit paper-(ripple)-buttons ? – maniacmusic Aug 06 '14 at 13:58
  • 1
    The problem is that `paper-input` wasn't originally meant to be used in a POST-based `
    ` workflow. It was made for Single-Page Applications. So yes, to get it to work with standard `
    `s requires JS. I've heard unofficially that the Polymer team is working on a `` element that will do this automatically.
    – CletusW Aug 06 '14 at 21:39
  • Thanks for the response. Is this already usable? https://github.com/PolymerLabs/paper-form – maniacmusic Aug 06 '14 at 21:58

2 Answers2

1

For Polymer 1.0 see the new Iron Form element.

Peter Kelley
  • 2,350
  • 8
  • 26
  • 46
0

You can try something like this - http://jsbin.com/kurelaji/2/edit

eth.block
  • 512
  • 1
  • 5
  • 17