So here's the thing i just wanna ask if this is possible the one the inputted or generated on the boxes of my form that i created is it possible that i could add a save button aside from the submit button. To be created on the same folder allocated with the .htm file, I mean i just want to have some records of my work everytime i input information of a people it would be saved into a text file. Is it possible?
Here's my code:
<html>
<body>
<form id="myForm">
Name: <br><input type="text" name="Name" placeholder="Name" size="40"/><br/>
Phone: <br><input type="text" name="Phone No" placeholder="Phone Number"/><br/>
Callback: <br><input type="text" name="Callback No" placeholder="Callback Number"/><br/>
CID: <br><input type="text" name="CID" placeholder="CID No" /><br/>
Status OK: <br><select name="Status" placeholder="Status"><option>Yes<option>No</select><br/>
INBOUND: <br><select name="INBOUND" placeholder="INBOUND"><option>Yes<option>No</select><br/>
<button type="button" onclick="ShowText();">Submit</button>
</form>
<p>Result:</p>
<p><textarea cols=40 rows=7 id="show" onClick='selectText(this);'></textarea></p>
<script>
function ShowText(){
// find each input field inside the 'myForm' form:
var inputs = myForm.querySelectorAll('input,select');
// declare 'box' variable (textarea element):
var box = document.getElementById('show');
// clear the 'box':
box.value = '';
// loop through the input elements:
for(var i=0; i<inputs.length; i++){
// append 'name' and 'value' to the 'box':
box.value += inputs[i].name + ': '+inputs[i].value+'\n';
}
}M
function selectText(textField)
{
textField.focus();
textField.select();
}
</script>
<textarea rows="9" cols="40">
Issue:
Steps:
</textarea>
</body></html>
Aucun commentaire:
Enregistrer un commentaire