I have many PHP includes on my webpage; I don't want them active until a button is clicked or someone hits enter.
AND then I would like to call the specific DIV ID [php include] and not all of them on the page.
I have an input field that the user would enter a zip code, then hit the go button or enter key, after that happens; I would like the script to activate the php include for that div ID.
For example: I have a - div id="zip60538" - that has a php include - [include myfile.php]
which I don't want activated on page load, I only want the DIV ID php include activated after the go button or enter is hit.
There will be a 100 div id's with PHP includes so I would like to be specific and only fire the matching DIV ID PHP Include and not all of them on the page. Each DIV is setup as zip(then the actual zip code) so zip60538 is the div ID and the user would enter 60538 in the input field.
What I was thinking is: 1. look at input box 2. if zip+(input box values) matches 3. then activate my.php include, in div id zip60538
is that possible?
$(document).ready(function(){
var zipCodes =[60538,60504,75001,76008,75002,75013,76009,76225,75409,76226,76001,76002,76006,76010,
76011,76012,76013,76014,76015,76016,76017,76018,76227,76020,75413,75180,75101,76021,
76022,75414,76126,75424,75418,76023,76028,75135,75006,75007,75010,76127,75104,75423,
75009,75105,76031,75211,76034,76233,75121,75019,75114,76035,76036,];
$("#buttontest").click(function(){
var zipIndex = zipCodes.indexOf(parseInt($("#full_day").val()));
$("#zipMessage > div").hide("fast");
var zipId = zipIndex > -1 ? zipCodes[zipIndex] : "Error";
$("#zip"+zipId).show("fast");
});
$("#full_day").keydown(function(e){
if(e.which === 13){
$("#buttontest").click();
}
});
});