Autocomplete with addtional parameters
Dear Sir
In a registration form Auto complete is working fine
I am accepting
After this I am accepting following 3 fields
For each auto complete I am using following script
(by changing appropriate values as per field and name of program called)
- $("#fathersname").autocomplete({
- source: "kvmasterdata_fathersnamesearch.php",
-
- minLength: 2,
- select: function(event, ui) {
- var getUrl = ui.item.id;
- if(getUrl != '#') {
- location.href = getUrl;
- }
- },
-
- html: true,
-
- open: function(event, ui) {
- $(".ui-autocomplete").css("z-index", 1000);
- }
- });
In this case what I want is
when I accept father's name (only after accepting the name i.e First Name )
I want to pass (the accepted) name as an additional parameter (for auto suggest values to be displayed)
so that my query will be
$query = 'SELECT distinct bg.name FROM kvmasterdata bg WHERE bg.name LIKE "%'.$user_input.'%"
and name='.$user_name ;
and NOT
$query = 'SELECT distinct bg.name FROM kvmasterdata bg WHERE bg.name LIKE "%'.$user_input.'%"';
Note :
where $user_name = value accepted in following field
Please help