Added JS variable criteria_json and hidden field
Edit code to fetch JS variable as selected criteria and new JSON structure