Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
<form name="nuevo_empleado" action="" onsubmit="enviarDatosEmpleado(); return false">
            <h2>Nuevo empleado</h2>
                <table>
                <tr>
                    <td>Nombres</td><td><label><input name="nombre" type="text" /></label></td>
                </tr>
                <tr>
                    <td>Apellido</td><td><label><input type="text" name="apellido"></label></td>
                </tr>
                <tr>
                    <td>Web</td><td><label><input name="web" type="text" /></label></td>
                </tr>
                <tr>
                    <td>&nbsp;</td><td><label><input type="submit" name="Submit" value="Grabar" /></label></td>
                    <td><label><input type="submit" name="submit" value="Modificar" /></label></td>
                    <td><label><input type="submit" name="submit" value="Eliminar" /></label>
                    </td>
                </tr>
                </table>
        </form>
</body>
</html>
 
document.addEventListener('DOMContentLoaded', function() {
  document.getElementsByName('nuevo_empleado')[0].onclick = function(e) {
    e.preventDefault();
    
    var target = e.target;
    var redirectHash = {
        grabar: 'registro.php',
        modificar: 'modificar.php',
        eliminar: 'eliminar.php'
    };
    
    if (target.type === 'submit') {
        window.location.href = redirectHash[target.value.toLowerCase()]; 
    }
};
});
Output 300px

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

Dismiss x
public
Bin info
anonymouspro
0viewers