php live select onchange

时间:2016-12-07 07:46:34

标签: javascript php jquery ajax

有人能帮助我吗?抱歉,我是PHP和jquery的新手。我在想是否用户更改了select标签。数据库中的详细信息将打印在文本框中,而无需使用ajax刷新页面。我现在没有ajax代码。因为我不知道我要做什么。

                <div class="row">
                    <div class="col-md-6 col-sm-12 col-xs-12">
                        <p>Full Name</p>
                        <select class="form-control" name="FullName" id="FullName" onchange="">
                            <option value="undefine">Select</option>
                            <?php
                                $query = mysql_query('SELECT tbluserdetail.FirstName,
                                                            tbluserdetail.MiddleName,
                                                            tbluserdetail.LastName,
                                                            tblchurchs.ChurchName,
                                                            tblchurchs.Address,
                                                            useraccounts.AccountID,
                                                            useraccounts.AccountNo
                                                            FROM useraccounts
                                                            INNER JOIN tbluserdetail
                                                            ON tbluserdetail.UserID = useraccounts.UserID
                                                            INNER JOIN tblchurchs
                                                            ON tblchurchs.AChurchID = tbluserdetail.AChurchID
                                                    ');
                                while($get_info = mysql_fetch_array($query)){
                                    $FName = specialchar($get_info['FirstName']);
                                    $MName = specialchar($get_info['MiddleName']);
                                    $LName = specialchar($get_info['LastName']);
                                    $CName = specialchar($get_info['ChurchName']);
                                    $CAdd = specialchar($get_info['Address']);
                                    $AN = specialchar($get_info['AccountNo']);
                                    $AI = specialchar($get_info['AccountID']);

                                    echo '<option value="'.$AI.'">'.$FName." ".$MName." ".$LName." (".$CName."-".$CAdd.")".'</option>';
                                }

                            ?>
                        </select>
                    </div>

                    <div class="col-md-6 col-sm-12 col-xs-12 ">
                        <p>Account No</p>
                        <input type="text" class="form-control" name="AccountNo" value=""Placeholder="000000" readonly>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-6 col-sm-12 col-xs-12 ">
                        <p>Address</p>
                        <input type="text" class="form-control" name="Address" readonly>
                    </div>
                    <div class="col-md-6 col-sm-12 col-xs-12 ">
                        <p>Contact No</p>
                        <input type="text" class="form-control" name="ContactNo" readonly>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-6 col-sm-12 col-xs-12 ">
                        <p>Gender</p>
                        <input type="text" class="form-control" name="Gender" readonly>
                    </div>
                    <div class="col-md-6 col-sm-12 col-xs-12 ">
                        <p>Age</p>
                        <input type="text" class="form-control" name="Age" readonly>
                    </div>
                </div>

1 个答案:

答案 0 :(得分:0)

此链接可能会回答我们的问题。它是实时过滤。 http://www.jqueryscript.net/demo/Create-Basic-Product-Filters-using-jQuery/