Originariamente inviata da
haippo
Salve ho creato un codice Random che mostra dei titoli all'interno di una textarea , con un pulsante invia per ricercare quest titoli su youtube.
non riesco a creare un unico form ,come faccio???
<!DOCTYPE html>
<html >
<head>
<script type='text/javascript'>
var tip=new Array()
// "\" escapes the next character in the line.
tip[0]="Queen"
tip[1]="Salmo"
tip[2]="Nirvana"
tip[3]="Dream"
tip[4]="Super"
tip[5]="Soccer"
function random_tips(){
var rt=Math.floor(Math.random()*tip.length)
document.randomform.randombox.value = tip[rt]
}
window.onload=random_tips
</script>
</head>
<body>
<form method="get" name='randomform'>
<input type='text' name='randombox' value=''>
<input type="submit" value="next" >
</form>
<form method="get" action="https://www.youtube.com/results?search_quer">
<input type="text" name="q" size="20" >
<input type="submit" name="q" value="Invia" >
</form>
<body>
<head>
</body>
</html>
</body>
</html>