function submit_filter() {

    //console.log(d3.event.target);

    // Prevent the page from refreshing
    d3.event.preventDefault();

    //Start --> Select input element for all parameters
    // Select the input element of Date parameter and get the raw HTML node
    var inputDateElement = d3.select("#datetime");
    // Select the input element of city parameter and get the raw HTML node
    var inputCityElement = d3.select("#city");
    // Select the input element of state parameter and get the raw HTML node
    var inputStateElement = d3.select("#state");
    // Select the input element of country parameter and get the raw HTML node
    var inputCountryElement = d3.select("#country");
    // Select the input element of shape parameter and get the raw HTML node
    var inputShapeElement = d3.select("#shape");
    //End --> Select input element for all parameters

    //Start --> Get prperty value for elements for all parameters
    // Get the value property of the input element of Date parameter
    var selected_date = inputDateElement.property("value");
    // Get the value property of the input element of city parameter
    var selected_city = inputCityElement.property("value");
    // Get the value property of the input element of state parameter
    var selected_state = inputStateElement.property("value");
    // Get the value property of the input element of country parameter
    var selected_country = inputCountryElement.property("value");
    // Get the value property of the input element of shape parameter
    var selected_shape = inputShapeElement.property("value");
    //End --> Select prperty value for elements for all parameters
    
    //Initialize filtereddata table with all data as table would be filtered for each parameter and filtered data would be passed 
    //to next filter instead of all data
    var filteredData=tableData;
    //Check value of each parameter and if exists then call filter function for that parameter
    if (selected_date || selected_city || selected_state || selected_country || selected_shape){
        //Call filterbyparameter for datetime parameter if value entered in parameter
        if (selected_date){

            var filteredData=filteredData.filter(filterbydate.bind(this,'datetime',selected_date));    
            console.log(filteredData);        
        }
    
        //Call filterbyparameter for city parameter if value entered in parameter
        if (selected_city){
    
            var filteredData=filteredData.filter(filterbydate.bind(this,'city',selected_city));    
            console.log(filteredData);        
        }
    
        //Call filterbyparameter for state parameter if value entered in parameter
        if (selected_state){
    
            var filteredData=filteredData.filter(filterbydate.bind(this,'state',selected_state));    
            console.log(filteredData);        
        }
    
        //Call filterbyparameter for country parameter if value entered in parameter
        if (selected_country){
    
            var filteredData=filteredData.filter(filterbydate.bind(this,'country',selected_country));    
            console.log(filteredData);        
        }
    
        //Call filterbyparameter for shape parameter if value entered in parameter
        if (selected_shape){
    
            var filteredData=filteredData.filter(filterbydate.bind(this,'shape',selected_shape));    
            console.log(filteredData);        
        }
    
        //Build data table for data filtered based on parameters selected
        builddatatable(filteredData);

    }

    else {
        alert("Please enter value in at least one of the parameter before search");
    }
}
// Event handler function for the date filter
Event handler function for the date filter
Event handler function for the date filter
function submit_filter() {
    d3.event.preventDefault();
    var inputDateElement = d3.select("#datetime");
    var inputCityElement = d3.select("#city");
    var inputStateElement = d3.select("#state");
    var inputCountryElement = d3.select("#country");
    var inputShapeElement = d3.select("#shape");
    var selected_date = inputDateElement.property("value");
    var selected_city = inputCityElement.property("value");
    var selected_state = inputStateElement.property("value");
    var selected_country = inputCountryElement.property("value");
    var selected_shape = inputShapeElement.property("value");
    var filteredData=tableData;
    if (selected_date || selected_city || selected_state || selected_country || selected_shape){
        if (selected_date){
            var filteredData=filteredData.filter(filterbydate.bind(this,'datetime',selected_date));    
            console.log(filteredData);        
        }
        if (selected_city){
            var filteredData=filteredData.filter(filterbydate.bind(this,'city',selected_city));    
            console.log(filteredData);        
        }
        if (selected_state){
            var filteredData=filteredData.filter(filterbydate.bind(this,'state',selected_state));    
            console.log(filteredData);        
        }
        if (selected_country){
            var filteredData=filteredData.filter(filterbydate.bind(this,'country',selected_country));    
            console.log(filteredData);        
        }
        if (selected_shape){
            var filteredData=filteredData.filter(filterbydate.bind(this,'shape',selected_shape));    
            console.log(filteredData);        
        }
        builddatatable(filteredData);
    }
    else {
        alert("Please enter value in at least one of the parameter before search");
    }
}
function submit_filter ( ) { d3 . event . preventDefault ( ) ; var inputDateElement = d3 . select ( "#datetime" ) ; var inputCityElement = d3 . select ( "#city" ) ; var inputStateElement = d3 . select ( "#state" ) ; var inputCountryElement = d3 . select ( "#country" ) ; var inputShapeElement = d3 . select ( "#shape" ) ; var selected_date = inputDateElement . property ( "value" ) ; var selected_city = inputCityElement . property ( "value" ) ; var selected_state = inputStateElement . property ( "value" ) ; var selected_country = inputCountryElement . property ( "value" ) ; var selected_shape = inputShapeElement . property ( "value" ) ; var filteredData = tableData ; if ( selected_date || selected_city || selected_state || selected_country || selected_shape ) { if ( selected_date ) { var filteredData = filteredData . filter ( filterbydate . bind ( this , 'datetime' , selected_date ) ) ; console . log ( filteredData ) ; } if ( selected_city ) { var filteredData = filteredData . filter ( filterbydate . bind ( this , 'city' , selected_city ) ) ; console . log ( filteredData ) ; } if ( selected_state ) { var filteredData = filteredData . filter ( filterbydate . bind ( this , 'state' , selected_state ) ) ; console . log ( filteredData ) ; } if ( selected_country ) { var filteredData = filteredData . filter ( filterbydate . bind ( this , 'country' , selected_country ) ) ; console . log ( filteredData ) ; } if ( selected_shape ) { var filteredData = filteredData . filter ( filterbydate . bind ( this , 'shape' , selected_shape ) ) ; console . log ( filteredData ) ; } builddatatable ( filteredData ) ; } else { alert ( "Please enter value in at least one of the parameter before search" ) ; } }
Event handler function for the date filter
Event handler function for the date filter
//console.log(d3.event.target); // Prevent the page from refreshing //Start --> Select input element for all parameters // Select the input element of Date parameter and get the raw HTML node // Select the input element of city parameter and get the raw HTML node // Select the input element of state parameter and get the raw HTML node // Select the input element of country parameter and get the raw HTML node // Select the input element of shape parameter and get the raw HTML node //End --> Select input element for all parameters //Start --> Get prperty value for elements for all parameters // Get the value property of the input element of Date parameter // Get the value property of the input element of city parameter // Get the value property of the input element of state parameter // Get the value property of the input element of country parameter // Get the value property of the input element of shape parameter //End --> Select prperty value for elements for all parameters //Initialize filtereddata table with all data as table would be filtered for each parameter and filtered data would be passed  //to next filter instead of all data //Check value of each parameter and if exists then call filter function for that parameter //Call filterbyparameter for datetime parameter if value entered in parameter //Call filterbyparameter for city parameter if value entered in parameter //Call filterbyparameter for state parameter if value entered in parameter //Call filterbyparameter for country parameter if value entered in parameter //Call filterbyparameter for shape parameter if value entered in parameter //Build data table for data filtered based on parameters selected