Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 94857

Want to add a mobile number at sign up time

$
0
0

I have register.js file :

var dialogs = require("ui/dialogs");
var el = require("../shared/models/el");
var frameModule = require("ui/frame");
var images = require("../shared/utils/images");
var pageData = require("../shared/models/userCredentials");
var viewModule = require("ui/core/view");
exports.load = function (args) {
    var page = args.object;
    var email = viewModule.getViewById(page, "email");
    var username = viewModule.getViewById(page, "username");
    var mobile = viewModule.getViewById(page, "mobile");
    pageData.set("email_address", "");
    pageData.set("username", "");
    pageData.set("password", "");
    pageData.set("mobile", "");
    pageData.set("logoSource", images.logo);
    page.bindingContext = pageData;
    // Turn off autocorrect and autocapitalization for iOS
    if (username.ios) {
        email.ios.autocapitalizationType =
            UITextAutocapitalizationType.UITextAutocapitalizationTypeNone;
        email.ios.autocorrectionType =
            UITextAutocorrectionType.UITextAutocorrectionTypeNo;
        username.ios.autocapitalizationType =
            UITextAutocapitalizationType.UITextAutocapitalizationTypeNone;
        username.ios.autocorrectionType =
            UITextAutocorrectionType.UITextAutocorrectionTypeNo;
    }
};
exports.register = function () {
    el.Users.register(
        pageData.get("username"),
        pageData.get("password"), {
            Email: pageData.get("email_address"),
            moblie: pageData.get("moblie")
        },
        
        function (response) {
            dialogs
                .alert("Your account was successfully created.")
                .then(function () {
                    frameModule.topmost().navigate("./views/login");
                });
        },
        function (error) {
            
            dialogs.alert({
                message:  "Unfortunately we were unable to create your account.",
                
                okButtonText: "OK"
            });
        }
    );
};

 

and written this in register.xml file

<Page loaded="load">
  <StackLayout>
      <Image source="{{ logoSource }}" />

      <Label text="Email Address:" />
      <TextField width="200" text="{{ email_address }}" id="email" hint="Email Address" keyboardType="email" />

      <Label text="Username:" />
      <TextField width="200" text="{{ username }}" id="username" hint="Username" />

      <Label text="Mobile No:" />
      <TextField width="200" text="{{ mobile }}" id="mobile"  hint="Mobile" keybordType="number" />
      
      <Label text="Password:" />
      <TextField width="200" text="{{ password }}" secure="true" hint="Password" />
      
      <Button text="Sign Up" tap="register" />
  </StackLayout>
</Page>

 

In the backend service I can see the usename and email address of the user but mobile number is not set. Guide me through this code.

Thanks

Manthan Shah


Viewing all articles
Browse latest Browse all 94857

Latest Images

Trending Articles



Latest Images