alin19 Posted February 2, 2008 Share Posted February 2, 2008 can i use something like this, but in stead of javascript to use php? <html> <script language="javascript" type="text/javascript"> <!-- function test() { with (document.forms.form1) { reset.disabled=false } } --> </script> <body> <form action="" method="POST" name="form1"> <input type="text" name="nume" value="nume" onchange="test()"> <input type="submit" name="submit" value="submit" onmouseover="test()"> <input type="reset" name="reset" value="reset" disabled=true> </form> </body> </html> Link to comment https://forums.phpfreaks.com/topic/89085-use-of-php-with-form/ Share on other sites More sharing options...
PHPoracle Posted February 2, 2008 Share Posted February 2, 2008 <form action="" method="POST" onSubmit="" name="form1"> Your forgetting the OnSubmit... Link to comment https://forums.phpfreaks.com/topic/89085-use-of-php-with-form/#findComment-456268 Share on other sites More sharing options...
papaface Posted February 2, 2008 Share Posted February 2, 2008 You can't do what you're trying to do with Javascript with PHP. Link to comment https://forums.phpfreaks.com/topic/89085-use-of-php-with-form/#findComment-456269 Share on other sites More sharing options...
The Little Guy Posted February 2, 2008 Share Posted February 2, 2008 NO... PHP runs on the server not the client. Link to comment https://forums.phpfreaks.com/topic/89085-use-of-php-with-form/#findComment-456270 Share on other sites More sharing options...
alin19 Posted February 2, 2008 Author Share Posted February 2, 2008 ok, i understand, but let's say that i get in a php array all the the ements from a table of mysql, can i pass them into a javascript array to use them later with what client does? Link to comment https://forums.phpfreaks.com/topic/89085-use-of-php-with-form/#findComment-456272 Share on other sites More sharing options...
The Little Guy Posted February 2, 2008 Share Posted February 2, 2008 Yeah, something like this: <script type="text/javascript"> <?php $sql = mysql_query("SELECT * FROM table"); $i = 0; while($row = mysql_fetch_array($sql)){ echo 'var myVar'.$i.' = "'.$row['fieldName'].'";'; $i++; } ?> </script> Link to comment https://forums.phpfreaks.com/topic/89085-use-of-php-with-form/#findComment-456278 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.