Skip to content

Instantly share code, notes, and snippets.

@carlosdelfino
Created November 23, 2010 16:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save carlosdelfino/711990 to your computer and use it in GitHub Desktop.
Save carlosdelfino/711990 to your computer and use it in GitHub Desktop.
Exemplo de codigo para abrir nova URL conforme um id inserido.
<html>
<head>
</head>
<body>
<form onsubmit="return false;">
<input id="textfield" value="0001" onchange="
var value = this.value;
if(value){
confirm('Abrindo URL para Cliente: '+value);
var finalurl = 'https://minhaurl.com.br/cadastro.php?cda='+value;
window.open(finalurl,'','');
}
" />
</form>
<script type="JavaScript">
<!--
var textfield = document.getElementById("prefix");
textfield.onLostFocus = textfield.onChange;
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment