The problem is that I have a HTML form with 4 text inputs, I submit it to a javascript function and the first 3 inputs work just fine but the fourth is undefined.
Here is the important code: The HTML part:
<form action="insertServer.php" method="post" id="insertServer">
Navn: <input type="text" name="navn" id="navn">
Netid: <input type="text" name="netid" id="netid">
Serverid: <input type="text" name="serverid" id="serverid">
Location: <input type="text" name="location" id="location">
<input type="submit" name="submitButton" class="button" id="submitButton" value="Indsend">
</form>
<div class="resultInsert"></div>
The Javascript part:
<script type='text/javascript'> //Add server
$("#insertServer").submit(function(event) {
event.preventDefault();
$("div.resultInsert").html("Location is:"+location.value+" navn is: "+navn.value);
});
</script>
When I type data into the fields and press submit the first 3 values are just fine but the fourth is shown as "undefined"
In case you need to see the entire file, I have created a gist for it here: https://gist.github.com/anonymous/8052481
Thanks