How to get alert using Json object

Posted by Manideepgoud under jQuery category on | Points: 40 | Views : 1622
Hello DotnetFunda,
In this tutorial, am going to show how to get alert using Json object
Now lets get in to the code
Html part

<p>Login and Register form</p>
<form id="getingValues" style="width:30%;">
<input type="text" name="Name" id="Name"></br>
<input type="text" name="Age" id="Age"></br>
<input type="text" name="Gender" id="Gender"></br>
<input type="password" name="password" id="Password"></br></br>

<!-- Buttons -->
<input type="button" value="Login" id="loginbtn">
<input type="button" value="Register" id="Registerbtn">

Coming to Javascript
var digitalData = "";
digitalData = {
"Login" :
{ "Name" : $('#Name').val(),
"Age" : $('#Age').val(),
"Gender" : $('#Gender').val(),
"Password" : $('#Password').val()
"Register" :
{ "Name" : $('#Name').val(),
"Age" : $('#Age').val(),
"Gender" : $('#Gender').val(),
"Password" : $('#Password').val()

Hope, You will understand.

Comments or Responses

Posted by: Clydeanderson on: 11/21/2018 Level:Starter | Status: [Member] | Points: 10
I hope I will understand it too. I just need some time to practice. And you probably need this Check it later.

Login to post response