I have form like bellow:
<?php
$list_id = $db_connect->get_results ( $db_connect->prepare ( 'SELECT * FROM users WHERE wp_ID= %d AND svr_region=%d', $wpid, 1 ) );
?>
<form name = "reset_data" action="<?php the_permalink(); ?>" method="post">
<select id = "select_id" name="select_id" required>
<option value="" > - Chose ID - </option>
<?php
foreach ( $list_id as $list_id ) {
$get_list_id = $list_id->ID ;
$get_list_name = $list_id->name ;
echo '<option value="' . $get_list_id . '" >[' . $get_list_id . '] ' . $get_list_name . '</option>' ;
}
?>
</select>
<select id = "select_role" name="select_role" >
<option value="" > - Chose Role - </option>
<?php
$get_role = GetRoleList ( $_POST['select_id'] ) ;
echo $get_role ;
?>
</select>
<input type="submit" value="Get Data! »"/>
</form>
how do i create jquery to disable #select_role if #select_id have empty value. #select_id value type is Integer. and after #select_id chosen, it will execute php function GetRoleList ( $_POST['select_id'] ) and return result like this '<option value="' . $nick_str . '" >' .$nick_str. '</option>'
Thank you
Aucun commentaire:
Enregistrer un commentaire