I want to create a simple javascript button that will be disabled once the current user clicked it.
I have a zend framework action that I d like to be called once the user clicks it but disabled the button for ever, if the current user already clicked it.
My zend framework action is something like this: `public function addvisitedlocationAction() {
$locationID = $this->_getParam('location_id');
echo "Location ID: " . $locationID;
$visited = 1;
$memberID = $this->view->identity;
$email= $memberID->email;
$currentUser = Model_DbTable_Members::getMember($email);
$memberID2 = $currentUser['id'];
echo '<br>Current Member id: ' . $memberID2;
//$profile = Model_DbTable_Members::findMembersProfile($email);
$this->view->currentMember = $currentUser;
//$this->view->theProfile = $profile;
$visitedModel = new Model_DbTable_MembersVisitedLocations();
$visitedModel->addMemberVisitedLocation($memberID2, $locationID,$visited);
return $this->_redirect('/restaurant/viewrestaurantlocationprofile/location_id/'. $locationID);
}//end of addvisitedLocation;`
I want to call this once the javascript button is clicked and disable the button for ever for that user.
My problem is I am familiar with javascript but don't really know where to start from. I have a simple image that I can use as a button. My aim is to call that action without redirecting the page and disable the button for the current user.
Any suggestions how I can achieve that?
Thanks.