I am currently working on a html file that prompts you to enter a name. It will then take that name and add it to a SQL server database. Here is the code:
<!DOCTYPE html>
<html>
<body>
<form name="customerForm" action="" method="get">
First Name: <input type="text" name="firstname" /><br />
Last Name: <input type="text" name="lastname" /><br />
<input type="button" name="button" value="Add Customer" onClick="addCustomer(this.form)">
</form>
<script type="text/javascript">
function addCustomer(form)
{
var x = form.firstname.value;
var y = form.lastname.value;
var name = x+" "+y;
alert(name);
}
</script>
</body>
</html>
Currently I have the javascript function to put the name into an alerty box to see if it worked.
I understand the html side of the program. What I don’t know is any kind of technology or efficient method to add the data into a SQL server database.
If anybody is willing to help, I would really appreciate it. Thank you.
You would need a server-side technology like ASP.NET, PHP, or something similar to take your form submission and do something with it on the server side.
There may be some kind of jQuery plugin of some sort to do this, but you would be better suited to learn one of the above technologies.
Is there some sort of reason why you cannot use a server-side technology?