Ad

Polymer Registration Form

- 1 answer

i'll get to the point, i'm fairly new at using polymer and i want to make a registration form that pushes data to php and to a Mysql server,however from what i understand you need to use iron-forms or ajax-form,which i dont fully understand. this deals with form submission and not verification the following is my code help will be greatly appreciated.

<paper-card>
          <h4 align="center">Sign Up</h4>
          <div id="Sign-Up">

            <template is="dom-bind" id="expand-demo">
          <paper-icon-button
              icon="hardware:keyboard-arrow-down"
              title="more info"
              on-tap="_toggleMoreInfo"
              style="float: right;">
          </paper-icon-button>
          <iron-collapse id="more-info">

          <form is="ajax-form" method="post" action="sign_up_connect.php" >
          <paper-input decorator label="First Name">
            <input id="firstName"  name="firstName">
          </paper-input>
          <paper-input decorator label="Last Name" >
            <input id="lastName"  name="lastName">
          </paper-input>
          <paper-input label="E-mail Address" id="email"></paper-input>

          <paper-input type="password"  label="Password" id="pass"></paper-input>
          <paper-input type="password"  label="Re-type Password"></paper-input>
          <paper-input type="number" max="70" min ="18"  label="Age" id="age"></paper-input>
          <p>Sex</p>
          <paper-radio-group selected="">
            <paper-radio-button name="Male">Male</paper-radio-button>
            <paper-radio-button name="Female">Female</paper-radio-button>
          </paper-radio-group>


          <paper-button raised id="button" type="submit" name="submit" value="Sign-Up" class="colorful" onclick="clickHandler(event)">Sign Up</paper-button>
          </iron-collapse>
          </template>
          </form>

          </div>
        </paper-card>
Ad

Answer

The iron-form can be observed via listeners. Keep in mind that the iron-form element is ajax-based (It will not reload the page), so you have to check yourself for its reponse / error in your element listeners. See http://jsbin.com/wefavu/edit?html,output

Ad
source: stackoverflow.com
Ad