php - Output on same form in Javascript -
php - Output on same form in Javascript -
this question exact duplicate of:
option field in html php 1 replyi want search employee list depend on area name selected dropdown list. can retrieve names of areas database dropdown list php html. confused how pass selected alternative in dropdown list sql query in php. want index numbers of selected options. code follows.
<html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <title></title> </head> <body> <?php include 'connect.php'; $query = "select varareaname tbarea" ; $result = mysql_query($query); echo'<select name="somename">'; echo'<option value="any">--any--</option>'; while($row = mysql_fetch_assoc( $result )) { echo '<option value="'.$row['varareaname'].'">' . $row['varareaname'] . '</option>'; } echo '</select>'; ?> </body> </html>
also want output on same form using javascript. new in javascript. please help me sort out.
you might want larn ajax this. dynamically altering page database using javascript possible when there's script performing server side operation (in case, database query).
this should going in direction. http://api.jquery.com/jquery.ajax/
also, obligatory - please don't utilize mysql deprecated , not maintained php more. utilize mysqli, or pdo.
php javascript html
Comments
Post a Comment