I was following the accepted solution to this question : HTML Dropdown list with user input field however I am unable to get it to work. I updated the jquery link, modified it to what i wanted but it doesn't insert any value and I was hoping someone could help me with that.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
Testing This:
<script language="javascript">
$(document).ready(function(){
$("#addLocation").click(function(){
$("#locationContainer").append('<option value="' + $("#newLocation").val() + '">' + $("#newLocation").val() + '</option>');
});
});
</script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<select name="imprint_location" id="locationContainer">
<option value="None" selected>None</option>
<option value="Front Right Breast">Front Right Breast</option>
<option value="Front Left Breast">Front Left Breast</option>
<option value="Full Back">Full Back</option>
<option value="Half Back">Half Back</option>
<option value="Barrell">Barrell</option>
<option value="Clip">Clip</option>
</select>
<input type="text" id="newLocation"/>
<input type="button" id="addLocation" value="Insert"/>
</body>
</html>
Get value to save to file: Would something like this work? Found on another question.
<?php
if(isset($_GET["filename"]) == true && isset($_GET["log"]) == true){
$fp = fopen($_GET["filename"], "a+");
if($fp !== null){
fputs($fp, $_GET["log"] . "\r\n");
fclose($fp);
}
}
?>
But how do i get the javascript value into this?
Thanks, MsKazza