I have this javascript code
<Script>
function getGroupId(){
var group=document.getElementById("selectedOptions").value;
var groupFirstLetter=group.substring(2);
}
</Script>
I need to pass the groupFirstLetter to a PHP function which will count how many users in this group and return the value to the javascript function.
Any ideas please?
Thanks,
You can use jQuery for that to post an AJAX request. See this example taken out of jQuery documentation:
The variable will be available in your PHP code as
$_POST['groupFirstLetter'].You can manipulate it as you wish then
echoa response to the browser again and it will be available in thedatavariable.references:
jQuery AJAX