Hey guys,
I am stuck with no vision when making an Ajax call - I am pretty new to this and Play...
So I make a call to my J.S via a form like this
<button type="button" class="btn btn-default" id="submitBtn" name="submitBtn" onclick="validatePassword()">Submit</button>
it tests my passwords to make sure they match, and that works
My next step is I want to see if the email address is in the database before signing up and I do not want to refresh the page..so I have this as the helper in my view
@()
@helper.javascriptRouter("jsRoutes")(
routes.javascript.SignupController.signup
)
inside the above JS script I have this (which I copied from here as an example way of calling it https://www.playframework.com/documentation/2.6.x/JavaJavascriptRouter#Embedded-router)
$.ajax(jsRoutes.controllers.SignupController.signup())
.done( /*...*/ )
.fail( console.log("failed here"));
Now at this stage I was expecting to see some sort of print out, but I cannot see any print out anywhere - can you give me an idea as to where I am going wrong?
I really wish there was more fuller examples on the play docs.