0

在这里我在这里发布我的代码问题是当我把我的自动完成的js和css邮政编码查找器的Ajax没有被触发并且当我删除我的自动完成的js和css时它工作正常请给我适当的解决方案。

    <head>
    <script type="text/javascript" src="js/plugins/jquery-1.7.min.js"></script>
    <script type="text/javascript" src="js/plugins/jquery.dataTables.min.js"></script>
    <script type="text/javascript" src="js/plugins/jquery-ui-1.8.16.custom.min.js"></script>
    <script type="text/javascript" src="js/custom/general.js"></script>
    <script type="text/javascript" src="js/custom/tables.js"></script>
    <script type="text/javascript" src="js/plugins/jquery.smartWizard-2.0.min.js"></script>
    <script type="text/javascript" src="js/plugins/jquery.colorbox-min.js"></script>
    <script type="text/javascript" src="js/plugins/jquery.validate.min.js"></script>
    <script type="text/javascript" src="js/custom/form.js"></script>
    </script>
    <style>
    .ui-autocomplete {
        max-height: 250px;
        max-width:60%;
        overflow-y: auto;
        /* prevent horizontal scrollbar */
        overflow-x: hidden;
    }

    autocomplete {
        max-height: 250px;
        max-width:60%;
        overflow-y: auto;
        /* prevent horizontal scrollbar */
        overflow-x: hidden;
    }
    </style>
    <!--auto complete start  for postcode finder-->
    <script type="text/javascript"  charset="utf-8">

    jQuery(document).ready(function()
     {
         jQuery( "#inputString" ).keydown(function() {

         jQuery( "#inputString" ).autocomplete({                   

                         source: "get_list1.php",

                         minLength: 3,               

                         select: function( event, ui ) {

                             //console.log(ui.item.address + "--" + ui.item.street_address + "--" + ui.item.type);  

                             jQuery('#h_pick_address').val(ui.item.address);                     

                             jQuery('#h_pick_street_address').val(ui.item.street_address);

                             jQuery('#h_pick_type').val(ui.item.type);

                             if(ui.item.type == 0 && ui.item.isPostCodeAnywhere ==1)

                             {                        

                                 jQuery.ajax({
                                     url: "get_list1.php",

                                     type: 'POST',  

                                     data: {action: 'get_postcode', id: ui.item.id },

                                     success: function(data)
                                     {
                                         try 
                                         {
                                             var response = jQuery.parseJSON(data);

                                             //console.log(response);

                                             jQuery('#h_pick_postcode').val(response.postcode);


                                         } catch(err) {

                                         }

                                     }

                                  });

                            }

                            else

                            {                           

                                jQuery('#h_pick_postcode').val(ui.item.post_code); 

                            }

                         }

                     }); 

        });

            jQuery( "#arrivestring" ).keydown(function() {

               jQuery( "#arrivestring" ).autocomplete({                   

                         source: "get_list1.php",

                         minLength: 3,

                         width: 100,                 

                         select: function( event, ui ) {

                             //console.log(ui.item.address + "--" + ui.item.street_address + "--" + ui.item.type);  

                             jQuery('#h_drop_address').val(ui.item.address);                     

                             jQuery('#h_drop_street_address').val(ui.item.street_address);

                             jQuery('#h_drop_type').val(ui.item.type);



                             if(ui.item.type == 0 && ui.item.isPostCodeAnywhere ==1)

                             {                        

                                 jQuery.ajax({
                                     url: "get_list1.php",

                                     type: 'POST',  

                                     data: {action: 'get_postcode', id: ui.item.id },

                                     success: function(data)
                                     {
                                         try 
                                         {
                                             var response = jQuery.parseJSON(data);

                                             //console.log(response);

                                             jQuery('#h_drop_postcode').val(response.postcode);


                                         } catch(err) {

                                         }

                                     }

                                  });

                            }

                            else

                            {                           

                                jQuery('#h_drop_postcode').val(ui.item.post_code); 

                            }


                         }

                     }); 

              });



        /* this is not complete that is not working
        jQuery("#phone").autocomplete("get_phone.php", {

            width: 260,

            matchContains: true,

            selectFirst: false,

                        });



        jQuery("#phonecorporate").autocomplete("get_phone_cor.php", {

            width: 260,

            matchContains: true,

            selectFirst: false,

                        });

        jQuery("#phonepersonal").autocomplete("get_phone_per.php", {

            width: 260,

            matchContains: true,

            selectFirst: false,

                        });

        jQuery("#phonetopup").autocomplete("get_phone_top.php", {

            width: 260,

            matchContains: true,

            selectFirst: false,

                        });*/



            jQuery('#wizard').smartWizard({onFinish: onFinishCallback});
            jQuery('#wizard2').smartWizard({onFinish: onFinishCallback});
            jQuery('#wizard3').smartWizard({onFinish: onFinishCallback});
            jQuery('#wizard4').smartWizard({onFinish: onFinishCallback});

            function onFinishCallback()
            {
                alert('Finish Clicked');
            }; 

            jQuery(".inline").colorbox({inline:true, width: '60%', height: '500px'});


    });

    </script>



    <!-- this is my js and css link for autocomplete
    <script type='text/javascript' src='js/jquery.autocomplete.js'></script>
    <link rel="stylesheet" type="text/css" href="css/jquery.autocomplete.css" />-->

    <!--auto complete end-->


    </head>

    <body class="loggedin" >

        <?php include("inc/header.php"); ?>

        <!-- START OF MAIN CONTENT -->
        <div class="mainwrapper">
            <div class="mainwrapperinner">

            <?php include("inc/mainleft.php"); ?>

            <div class="maincontent">
                <div class="maincontentinner">

                    <ul class="maintabmenu">
                        <li class="current"><a href="dashboard.html">Booking Registration</a></li>
                    </ul>

                    <div class="content">

                         <div class="contenttitle">
                            <h2 id="default" class="form"><span>Quick Quote & Booking</span></h2>
                        </div><!--contenttitle-->


                        <br /><br />


                        <!-- START OF DEFAULT WIZARD -->


                        <form class="stdform stdform2" action="submit.php" method="post" name="myform" id="step2">
                            <div id="wiz1step1" class="formwiz">
                                <h2>Step 1: Quick Quote</h2> 

预订类型

                                        <span class="field">
                                        <select name="bookingtype" id="bookingtype" class="smallinput2" >
                                            <option value="0">Choose One</option>
                                            <option value="1" id="reg" >Regular User</option>
                                            <option value="2" id="cor" >Corporate User</option>
                                            <option value="3" id="per" >Personal User</option>
                                            <option value="4" id="top" >Topup User</option>
                                        </select>
                                        </span>
                                    </p>




                                 <div id="phonereg" style="display:none;" >
                                 <div id="dropdown">    
                                 <p>
                                <label>Contact Details</label>
                                <span class="field">
                     <input type="text" placeholder="Phone No."  id="phone" class="smallinput" onblur="getbyphone();"  /> 
                                </span>
                                </p>
                             </div>
                             </div> 


                             <div id="phonecor" style="display:none;" >
                            <div id="dropdownc">
                                 <p>
                                <label>Contact Details</label>
                                <span class="field">
                    <input type="text" placeholder="Phone No."  name="phonecorporate" id="phonecorporate" class="smallinput" onblur="getbyphone_corporate();"  />
                   </span>
                   </p>
                   </div>
                    </div> 



                   <div id="phoneper" style="display:none;" >
                   <div id="dropdownp">
                   <p>
                                <label>Contact Details</label>
                                <span class="field">
                  <input type="text" placeholder="Phone No." name="phonepersonal" id="phonepersonal" class="smallinput" onblur="getbyphone_personal();"   />
                   </span>
                   </p>
                   </div>
                   </div>


                   <div id="phonetop" style="display:none;" >
                   <div id="dropdownt">
                   <p> 
                                <label>Contact Details</label>
                                <span class="field">
                          <input type="text" placeholder="Phone No." name="phonetopup" id="phonetopup" class="smallinput" onblur="getbyphone_topup();"  />
                   </span>
                   </p>
                   </div>
                   </div>
                   <!-----------------   for different phone taker  end   -------------------------->



                    <!-----------------   for name of user   -------------------------->


                        <div id="customername" style="display:none;" >
                        <p>
                                <label>Customer Name</label>
                                <span class="field"><input type="text" placeholder="First Name" name="fname" id="fname" class="smallinput2" />
                                <input type="text" placeholder="Last Name" name="lname" id="lname" class="smallinput2" /></span>
                            </p>
                      </div>  


                         <div id="regular" style="display:none;"  >
                                <p>
                                <label>Company Name</label>
                                <span class="field"><input type="text" name="Company" id="Company" class="smallinput" />
                                </span>
                                    </p>
                                    </div>


                                    <div id="topupd" style="display:none;" >
                                      <p>
                                <label>Topup Username</label>
                                <span class="field"><input type="text" name="topup" id="topup" class="smallinput" />
                                </span>
                                    </p>
                                    </div>

                                   <div id="personald" style="display:none;" >  
                                      <p>
                                <label>Personal Username</label>
                                <span class="field"><input type="text" name="personal" id="personal" class="smallinput" />
                                </span>
                                    </p>
                                    </div>

                   <!----------------     end of name ------------------>


                                    <p >
                                        <label>Pickup Point</label>
                                        <span class="field">
      <input type="text" class="smallinput"  name="pickupaddress" id="inputString" placeholder="Eg: Heathrow Airport / Postcode" value=""  />  

                    <input id="h_pick_postcode" type="hidden" name="h_pick_postcode" value="0">
                      <input id="h_pick_type" type="hidden" name="h_pick_type" value="0">
                      <input id="h_pick_address" type="hidden" name="h_pick_address" value="0">
                      <input id="h_pick_street_address" type="hidden" name="h_pick_street_address" value="0">  
                     </span>
                                    </p>

                                    <p>
                                        <label>Drop off Point</label>
                                        <span class="field">
     <input type="text"   class="smallinput"  name="dropaddress" id="arrivestring" placeholder="Eg:  W1B 3HH  / Postcode" value="" />

                        <input id="h_drop_postcode" type="hidden" name="h_pick_postcode" value="0">
                      <input id="h_drop_type" type="hidden" name="h_pick_type" value="0">
                      <input id="h_drop_address" type="hidden" name="h_pick_address" value="0">
                      <input id="h_drop_street_address" type="hidden" name="h_pick_street_address" value="0"> 



          <a href='javascript:viewmap(),getdistance()'> View Map </a> 

                                        </span>
                                    </p>   <div id="quote_map_container" style="display: none; width: 717px; height:200px; margin-top: 5px; margin-bottom: 5px;"></div> 



                              <div id="distanceduration" style="display:none;">     
                                    <p>

                        <label>Distance</label>
                                        <span class="field">
      <input type="text" class="smallinput"  name="distance" id="distance"  value=" " />      

                                        </span>

                       </p>


                                <p>

                        <label>Duration</label>
                                        <span class="field">
      <input type="text" class="smallinput"  name="duration" id="duration"  value="" />      

                                        </span>

                       </p>
                       </div>


                                       <p>
                                        <label>Details</label>

                                        <span class="field">


                                       <?php $vehicle_all = $db->GetAll("SELECT * FROM vehicle WHERE active=1"); ?>
                                        <select name="car" id="car"  class="smallinput" onchange="abc()">
                                        <option value="none" disabled="disabled" selected="selected">  --Select Car-- </option>
                                        <? foreach($vehicle_all as $k=>$r) { ?>

                                            <option value="<?= $r['car'] ?>" > <?= $r['car'] ?></option>  
                                               <?php } ?>
                                        </select>
                                        </span>
                                        </p>


                                        <p>

                                        <label>Price</label>
                                        <span class="field">


                     <input type="text" name="price" id="divtotal" class="smallinput" value="<?php $result1 ?>"  />                

                      <input type="hidden"  id="price" value="<?php $result1 ?>"  />         

                                        </span>

                                    </p>

                            </div><!--#wiz1step1-->



                            <div id="wiz1step2" class="formwiz" >
                                <h2>Step 2: Registration</h2> <br />
                                                    <div class="contenttitle">
                            <h2 class="form"><span>Simple Form with Validation</span></h2>
                        </div><!--contenttitle-->

                                     <div id="visible"   style="visibility:hidden;" >




                            <div id="corporate" style="display:none;" >


                            <p>
                             <label>Email id</label>
                                <span class="field">
                                <input type="text" placeholder="Email" name="email" id="email" class="longinput" /></span>
                            </p>
                            </div>

                           <div id="personal">
                            <p>
                                <label>Pickup Details</label>
                                <span class="field">
                                <input name="picupdate"  class="smallinput2" tabindex="8" id="datepicker" readonly="readonly" />




                    </span>
                            </p>

                             <p>


                            </div>

                            <p>

                      <p>

                                    <label>Return Journey:</label>

                                       </span>
                                    </p>
                        <div id="target_div" style="display: none" >
                                    <p >
                                <label>Return Details</label>
                                <span class="field"><input name="return_date"  class="smallinput2" tabindex="8" id="datepicker1" readonly="readonly"  />

                                 <select  name="return_pic_time" id="return_pic_time" style="width:21%;"  >
                          <option selected="selected" value="">Select</option>
                          <option value="00">00 hrs</option>
                          <option value="01">01 hrs</option>
                          <option value="02">02 hrs</option>
                          <option value="03">03 hrs</option>
                          <option value="04">04 hrs</option>
                          <option value="05">05 hrs</option>
                          <option value="06">06 hrs</option>
                          <option value="07">07 hrs</option>
                          <option value="08">08 hrs</option>
                          <option value="09">09 hrs</option>
                          <option value="10">10 hrs</option>
                          <option value="11">11 hrs</option>
                          <option value="12">12 hrs</option>
                          <option value="13">13 hrs</option>
                          <option value="14">14 hrs</option>
                          <option value="15">15 hrs</option>
                          <option value="16">16 hrs</option>
                          <option value="17">17 hrs</option>
                          <option value="18">18 hrs</option>
                          <option value="19">19 hrs</option>
                          <option value="20">20 hrs</option>
                          <option value="21">21 hrs</option>
                          <option value="22">22 hrs</option>
                          <option value="23">23 hrs</option>
                        </select>
           <select  name="r_mm" id="r_mm" style="width:21%;"  >
                          <option selected="selected" value="">Select</option>
                          <option value="00">00 mins</option>
                          <option value="05">05 mins</option>
                          <option value="10">10 mins</option>
                          <option value="15">15 mins</option>
                          <option value="20">20 mins</option>
                          <option value="25">25 mins</option>
                          <option value="30">30 mins</option>
                          <option value="35">35 mins</option>
                          <option value="40">40 mins</option>
                          <option value="45">45 mins</option>
                          <option value="50">50 mins</option>
                          <option value="55">55 mins</option>
                        </select>
        </span>
                            </p>

                             <p>
                                <label>Return Flight Details</label>
                                <span class="field">
                                <input type="text" placeholder="Flight no" name="r_flightno1" id="r_flightno1" class="smallinput2" />
                                <input type="text" placeholder="Airport arrivig From" name="flying_return" id="flying_return" class="smallinput2" />
                                </span>
                            </p>

                           </div> 


                            <p class="stdformbutton">
                                <button class="submit radius2" name="submit" id="submit">Submit Button</button>
                            </p>
                            </div>

                                 </div> 

                           <!--#wiz1step2-->


                           <!--#wiz1step3-->

                             <div id="wiz1step3">
                                <h2>Step 3: Payment & Terms of Agreement</h2> <br />

                                    <p>
                                <label>Payment Method</label>
                                <span class="field">
                                    <input type="radio" name="radiofield" /> Cash &nbsp;&nbsp;
                                    <input type="radio" name="radiofield" /> CardSave 
                                </span>
                            </p>
                                    <p><input type="checkbox"  /> I agree with the terms and agreement...</p>

                            </div><!--#wiz1step3-->

                        </div><!--#wizard-->
                        </form>

                        <!-- END OF DEFAULT WIZARD -->
                        <br clear="all" /><br /><br />                    
                    </div>

                    <?php include("inc/footer.php"); ?>

           </div>
           </div>
            </div>
                </div>
    </body>
    </html>
4

1 回答 1

0

尝试这个

<script>
$.noConflict();
// Code that uses other library's $ can follow here.
</script>
于 2013-10-30T11:48:00.640 回答