JavaScript I need to make an alert box that shows what user entered in comment section

I don't know why this code won't work. I need a simple solution. This is just a college project and it doesn't have to do more then just following: I want to make ti so that when someone enters their name, location and eaddress, gender and comment alert box pops up with this kind of form:

Name, Location, eAddress, Gender
comment...

Code:

<div style="font-family:'Cinzel';text-align:center;">
    Ime: <input type="text" name="Ime" value=""><br></br>
    Lokacija: <input type="text" name="Lokacija" value=""></br><br>
    E Adresa: <input type="text" name="eAdresa" value=""></br><br>
 <form>
  <input type="radio" name="gender" value="male" checked> Muško
  <input type="radio" name="gender" value="female"> Žensko
  <input type="radio" name="gender" value="other"> Drugo<br>
  <button onclick="Ispis()">Pošalji</button>
</form> 
    <textarea rows="4" cols="50" name="Komentar" form="usrform" placeholder="Ostavite komentar..."></textarea>
</div>
<script>
    function Ispis(){
        var Ime=getElementsByName=("Ime")[0].value;
        var lokacija=getElementsByName=("Lokacija")[0].value;
        var eAdresa=getElementsByName=("eAdresa")[0].value;
        var Pol=getElementsByName=("gender")[0].value;
alert(Ime+","+Lokacija+","+eAdresa+","+Gender+"<br>"+Komentar);
}
</script>
Answer:1

You can change your code as below to work...

<div style="font-family:'Cinzel';text-align:center;">
    Ime: <input type="text" name="Ime" value=""><br></br>
    Lokacija: <input type="text" name="Lokacija" value=""></br><br>
    E Adresa: <input type="text" name="eAdresa" value=""></br><br>
 <form>
  <input type="radio" name="gender" value="male" checked> Muško
  <input type="radio" name="gender" value="female"> Žensko
  <input type="radio" name="gender" value="other"> Drugo<br>
  <button onclick="Ispis()">Pošalji</button>
</form> 
    <textarea rows="4" cols="50" name="Komentar" form="usrform" placeholder="Ostavite komentar..."></textarea>
</div>
<script>
    function Ispis(){
        var Ime=document.getElementsByName("Ime")[0].value;
        var lokacija=document.getElementsByName("Lokacija")[0].value;
        var eAdresa=document.getElementsByName("eAdresa")[0].value;
        var Gender=document.getElementsByName("gender")[0].value;
        var Komentar=document.getElementsByName("Komentar")[0].value;
        debugger
        alert(Ime+","+lokacija+","+eAdresa+","+Gender+"\n"+Komentar);
}
</script>
Answer:2

I resolve a problem which was showing up no compatibility on Edge but in Chrome. So, I changed using Object.assign(a, {}) instead of {...a, {}}. Here's where I discussed this previous problem: I ...

I resolve a problem which was showing up no compatibility on Edge but in Chrome. So, I changed using Object.assign(a, {}) instead of {...a, {}}. Here's where I discussed this previous problem: I ...

  1. script1005 expected '('
  2. script1005 script1005 expected '(' edge

I want to flip the bottom label in my hierarchical edge bundling(pie chart) where it says "Projekter" so it's readable, is that a possibility? i have this jfiddle to demonstrate: https://jsfiddle.net/...

I want to flip the bottom label in my hierarchical edge bundling(pie chart) where it says "Projekter" so it's readable, is that a possibility? i have this jfiddle to demonstrate: https://jsfiddle.net/...

I have this object Object { "87291": "valid", "1873681927": "valid", "nwq89j8jw0qj9": "valid", "oVFYfWIUOsONE6JyMGYAbnsPMAr1": "valid", } what i want to do is remove object based on key ...

I have this object Object { "87291": "valid", "1873681927": "valid", "nwq89j8jw0qj9": "valid", "oVFYfWIUOsONE6JyMGYAbnsPMAr1": "valid", } what i want to do is remove object based on key ...

  1. javascript object array find
  2. javascript object array sort
  3. javascript object array filter
  4. javascript object array contains
  5. javascript object array to string
  6. javascript object array get value by key
  7. javascript object array length
  8. javascript object array iterator
  9. javascript object array as key
  10. javascript object array indexof
  11. javascript object array foreach
  12. javascript object array example
  13. javascript object array map
  14. javascript object array notation
  15. javascript object array to json
  16. javascript object array remove duplicates
  17. javascript object array search
  18. javascript object array find index
  19. javascript object array add item
  20. javascript object array to csv

Is there an efficient way to toggle the Boolean value of multiple variables at once? My variables are lines that I want to show/hide depending on userValue. myList = [lineA, lineB, lineC, lineD] My ...

Is there an efficient way to toggle the Boolean value of multiple variables at once? My variables are lines that I want to show/hide depending on userValue. myList = [lineA, lineB, lineC, lineD] My ...