badmullah_1 0 Newbie Poster

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;

    }
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.