Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
    <form id="form" method="post" name="">
        <input  type="text" name="email" placeholder="Введите email" i />
        <input type="text" name="phone" placeholder="Введите телефон"  /> <br />
        <input type="button" onclick="valid(document.getElementById('form'))" name="submit" value="Готово" />
    </form>
 
function valid(form){
    var error = false;
    var email = form.email.value;
    var phone = form.phone.value;
        if(email == "" || email == " ")
            error = "Вы не ввели email";
        else if (phone == "")
            error = "Вы не ввели телефон";
        if(error)
            alert(error);
        
}   
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers