I'm currently working on implementing session variables in Joomla with AJAX when checkboxes are selected. Below is the code snippet from select_thumb.ajax.php file:
$_SESSION['ss'] = $value;
$response = $_SESSION['ss'];
echo $response;
}
exit;
// Get db connection
$db = JFactory::getDbo();
//create new query object
$query = $db->getQuery(true);
//Prepare insert query
$query
->insert($db->valueChbx('download_variable'))
// Set the query using populated query object and execute it.
$db->setQuery($query);
$db->execute();
?>
Below is the HTML code for the checkboxes:
<input type="checkbox" id="thumbselect" name="valueChbx" class="checkbox" value="/import/images/'+data[i]['filename']+'">';
I haven't started coding the AJAX using JavaScript yet. I'm considering using onFocus, but I'm unsure if that's the best approach, especially since multiple checkboxes may be selected simultaneously. Any guidance or assistance would be greatly appreciated.