Using variable with php from javascript onsubmit event
-
30-10-2019 - |
Frage
I'm trying to use a value from onsubmit() in php.
More specific: An HTML form is being submitted by the client. The onSubmit passes it to a couple of javascript functions. One of these functions is supposed to fetch a list of registered emails from the database to check if it is already used.
<?php
$email='?> frm.add_fd2.value <?php ';
// execute query
$num_rows = mysql_num_rows($result); ?>
var num_rows = <?php echo (is_int($num_rows)) ? $num_rows : 0; ?>;
if (num_rows > 0) {
// JAVASCRIPT ERROR
}
Keine korrekte Lösung
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow