Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>X-factor</title>
- </head>
- <body>
- <script type="text/javascript">
- function funkcija(){
- var ime=document.getElementById("ime");
- var uime=document.getElementById("umetinickoIme");
- console.log(ime.value);
- if(!ime.value.match(/\S/) || !uime.value.match(/\S/)){
- alert("Сите полиња се задолжителни");
- }
- else{
- var pol=document.getElementsByName("pol");
- console.log(pol);
- if(pol[0].checked){
- pol="машко";
- }
- else if(pol[1].checked){
- pol="женско";
- }
- alert(ime.value + "\n" +pol +"\n" + document.getElementById("odberi").value + "\nУспешно се пријавивте");
- }
- }
- </script>
- <h1>Форма за пријавување на X-Factor</h1>
- <table>
- <tr>
- <td>Име</td>
- <td ><input id="ime" type="text"></td>
- </tr>
- <tr>
- <td>Уметничко име</td>
- <td ><input id="umetinickoIme" type="text"></td>
- </tr>
- <tr>
- <td>Пол</td>
- <td>
- <input type="radio" name="pol" id="maski">Машки
- <input type="radio" name="pol" id="zenski">Женски
- </td>
- </tr>
- <tr>
- <td>Жанр: </td>
- <td>
- <select id="odberi">
- <option>Classical</option>
- <option>Pop</option>
- <option>Rock</option>
- </select>
- </td>
- </tr>
- </table>
- <button type="button" onclick="funkcija()">Пријави се</button>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement