I'm relatively new to Javascript/JSON and I've been looking really long for an example of how to do this. Currently what I have in my View is
<p>Please enter your email and phone number registered with the account</p>
<table id="Table">
<tr>
<td>Email</td>
<td> <input id = "email" type ="text" name= "email" /></td>
</tr>
<tr>
<td>Phone Number</td>
<td> <input id = "phone" type ="text" name= "phone" /></td>
</tr>
</table>
<input type="button" value="Submit" id="sendMSG">
I'd like to send it to the following controler
public JsonResult SendMessage(SMSTestViewModel model)
{
string email = model.email;
string number = model.phone;
}
What i'd like to do is to write a script to say that when I click the button, to send the information I put in the two textboxes to my viewmodel and then to my controller. I'd also like to do this while it doesn't referesh the page.
If you can possibly lead me in the right direction, that;d be awesome.