hi
i've this form:
<form action="<?=$_SERVER['PHP_SELF']?>" method="POST" onkeypress="if(window.event.keyCode==13){this.submit()};">
<p>Base de dados:
<select name="db">
<?php
$dbs = mysql_list_dbs();
for ($i=0;$i<mysql_num_rows($dbs);$i++) {
$dbname = mysql_db_name($dbs,$i);
if ($dbname == $db)
echo("<option selected>$dbname</option>\n" );
else
echo("<option>$dbname</option>\n" );
}
?>
</select>
</p>
<p>SQL:<br />
<textarea cols="60" rows="5" name="query"><?=htmlspecialchars($query)?></textarea>
</p>
<p><input type="submit" name="submitquery" value="Ver" /></p>
</form>
and want to submit by either clikin on button or by pressing the enter key;
the way it is only reloads the web page and resets the select option...
How can i achieve it?
Thanks
i've this form:
<form action="<?=$_SERVER['PHP_SELF']?>" method="POST" onkeypress="if(window.event.keyCode==13){this.submit()};">
<p>Base de dados:
<select name="db">
<?php
$dbs = mysql_list_dbs();
for ($i=0;$i<mysql_num_rows($dbs);$i++) {
$dbname = mysql_db_name($dbs,$i);
if ($dbname == $db)
echo("<option selected>$dbname</option>\n" );
else
echo("<option>$dbname</option>\n" );
}
?>
</select>
</p>
<p>SQL:<br />
<textarea cols="60" rows="5" name="query"><?=htmlspecialchars($query)?></textarea>
</p>
<p><input type="submit" name="submitquery" value="Ver" /></p>
</form>
and want to submit by either clikin on button or by pressing the enter key;
the way it is only reloads the web page and resets the select option...
How can i achieve it?
Thanks