I like to know if its possible to create a web page and provide the TEXT that needs to be SAVED in some kinda file or Table to be provided at the command line in as part of the URL
sending email from a webpage
I am trying to send an email from an HTML page using JS
In windows the outlook opens up and the fields are populated , however when I click on the same link to the HTML on my iphone ,
var subject = "NPS:" + document.getElementById("jid").value
var emailto = "sed.ahimi@ico.com"
var BodyMessage = "Node:"+subject+'%0D%0A'+"SCORE:" +document.getElementById("myRange").value+'%0D%0A'+"COMMENTS:"+document.getElementById("notes").value+""
var wmail="mailto:"+emailto +"?subject="+subject+"&body="+BodyMessage;
window = window.open(wmail, 'emailWindow')
I don't see anything being opened
how to fetch the values of the controls
hi
I need your help if you know JS to fetch 3 values
//value of JID2 input
//value of slider
//value of the NOTES
but since JS is new to me i would need your help please.
it is a form with a few controls that user can check , then he she clicks on submit and
then I need to know what the values of the controls are when constructing 'yourMessage' variable
Thank you
<body onload="loaded();">
<p>Job ID:</p>
<input type="text" id ="jid2" name="jid2">
<p>Use the slider to select your Satisfacion </p>
<p>score for the service provided.
<div class="slidecontainer">
<input type="range" min="1" max="10" value="5" class="slider" id="myRange">
Value: <span id="demo"></span>/10</p>
</div>
<div>
<textarea rows="5" cols="40" name="NOTES" placeholder="Additional comments:"></textarea>
<br>
</div>
<script>
var slider = document.getElementById("myRange");
var input = document.getElementById("input");
var output = document.getElementById("demo");
output.innerHTML = slider.value;
const button = document.createElement('button')
button.innerText = 'SUBMIT'
button.id = 'mainButton'
button.addEventListener('click', () => {
//NEED:
//value of JID2 input
//value of slider
//value of the NOTES
var yourMessage = "my message"
var subject = " my subject "
var emailto = "abc@gmail.com"
var wmail="mailto:"+emailto +"?subject="+subject+"&body="+yourMessage;
window = window.open(wmail, 'emailWindow')
})
document.body.appendChild(button)
slider.oninput = function()
{
output.innerHTML = this.value;
}
function loaded()
{
const urlSearchParams = new URLSearchParams(window.location.search);
const params = Object.fromEntries(urlSearchParams.entries());
if(params.jid2)
{
document.getElementById("jid2").value = params.jid2;
}
if(params.demo)
{
document.getElementById("demo").value =params.dem;
}
}