0

I have the following code which works fine:

  <script type="text/javascript">
Parse.initialize("Lvw6b7TPacv0DX949odBhUPo2nqH5az7SPg6qoiD", "PIuBiR1tGtdJ8IDMnX3yEiljW4V3FQjeoEOhmzEW");

var Recipe = Parse.object.extend("UserSignUp");
var recipe = new Recipe();
  recipe.save({username: "<?php echo $Username  ?>",password: "<?php echo $Password  ?>",title: "<?php echo $Title ?>",name: "<?php echo $Name ?>",email: "<?php echo $Email ?>",summary: "<?php echo $Summary ?>"}, {
  success: function(object) {
    $(".success").show();
  },
  error: function(model, error) {
    $(".error").show();
  }
});

However this saves to a usersignup class which I created. Ideally I need the data to be saved the User installation class however I am unable to do so.

How can this be achieved??

1 Answer 1

1

For sure, the code creates a UserSignUp (confusingly named Recipe) and saves it. The create method for Parse.User is called signUp().

copied from the doc:

var user = new Parse.User();
user.set("username", "my name");
user.set("password", "my pass");
user.set("email", "[email protected]");

// other fields can be set just like with Parse.Object
user.set("phone", "415-392-0202");

user.signUp(null, {
  success: function(user) {
    // Hooray! Let them use the app now.
  },
  error: function(user, error) {
    // Show the error message somewhere and let the user try again.
    alert("Error: " + error.code + " " + error.message);
  }
});
Sign up to request clarification or add additional context in comments.

1 Comment

We have changed that around however we are getting an error: error100XMLHttpRequest failed: {"readyState":4,"timeout":0,"onloadend":null,"withCredentials":false,"onloadstart":null,"status":0,"ontimeout":null,"onabort":null,"upload":{"onabort":null,"onload":null,"onprogress":null,"onerror":null,"onloadstart":null,"onloadend":null},"responseType":"","response":"","responseXML":null,"onload":null,"onerror":null,"statusText":"","onprogress":null,"responseText":""}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.