Software Archive
Read-only legacy content

Ionic Form

nicolas_r_
Beginner
414 Views

 

Hi i im working whit ionic as framework but i have some trouble i need to get data from some input and save it, to send them by JSON this is the structure that im using and i need to get the label and the selected item. i also want to try an alert when the data is send. 

<div class="list">
                        <div class="list">
                            <form ng-submit="submitEvent(event)">
                            <label class="item item-input">
                                <span class="input-label">Rut</span>
                                <input type="text" ng-model="event.rut">
                            </label>
                            <label class="item item-input">
                                <span class="input-label">Nombre</span>
                                <input type="text" ng-model="event.nombre">
                            </label>
                            <label class="item item-input">
                                <span class="input-label">Apellido</span>
                                <input type="text" ng-model="event.apellido">
                            </label>
                            <label class="item item-input">
                                <span class="input-label">Telefono</span>
                                <input type="text" ng-model="event.telefono">
                            </label>
                            <label class="item item-input item-select">
                            <div class="input-label">
                                Region
                            </div>
                            <select>
                                <option>XIV Los Rios</option>
                            </select>
                            </label>
                            <label class="item item-input item-select">
                            <div class="input-label">
                                Comuna
                            </div>
                            <select>
                                <option>Valdivia</option>
                                <option>Mariquina</option>
                                <option>Lanco</option>
                                <option>Mafil</option>
                                <option>Corral</option>
                                <option>La Union</option>
                                <option>Paillaco</option>
                                <option>Los Lagos</option>
                                <option>Rio Bueno</option>
                                <option>Futrono</option>
                                <option>Panguipulli</option>
                                <option>Lago Ranco</option>
                            </select>
                            </label>
                <label class="item item-input item-select">
                <div class="input-label">
                  Tipo de Sangre
                </div>
                <select>
                            <option>A+</option>
                            <option>A-</option>
                            <option>B+</option>
                            <option>B-</option>
                            <option>AB+</option>
                            <option>AB-</option>
                            <option>0+</option>
                            <option>0-</option>
                 </select>
                </label>
                            </form>
                        </div>

<button class="button widget uib_w_54 d-margins button-assertive" data-uib="ionic/button" data-ver="0">Enviar</button>

0 Kudos
1 Solution
Chris_P_Intel
Employee
414 Views

How familiar with Angular are you?  Ionic is well married to Angular, and you need to have a good grasp of that to go forward much with Ionic.

I see your form has an ng-submit attribute which names the submitEvent() handler.  Do you have a directive with that handler? Is that directive bound into your App Controller declaration?  

Do those questions make sense? If not, you are going to have to study up on some Angular JS as well as the Ionic Framework. You might also try asking this question on the Ionic Framework forums - they are more familiar with the Ionic way than we are.

Chris

View solution in original post

0 Kudos
2 Replies
Chris_P_Intel
Employee
415 Views

How familiar with Angular are you?  Ionic is well married to Angular, and you need to have a good grasp of that to go forward much with Ionic.

I see your form has an ng-submit attribute which names the submitEvent() handler.  Do you have a directive with that handler? Is that directive bound into your App Controller declaration?  

Do those questions make sense? If not, you are going to have to study up on some Angular JS as well as the Ionic Framework. You might also try asking this question on the Ionic Framework forums - they are more familiar with the Ionic way than we are.

Chris

0 Kudos
nicolas_r_
Beginner
414 Views

thanks for the info i know very few about angular, so i will check a little bite more about.

0 Kudos
Reply