Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9158627
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T13:17:34+00:00 2026-06-17T13:17:34+00:00

Sample code : jQuery(function() { jQuery(‘#changePwYes’).click(function(){ <?php $this->session = new Zend_Session_Namespace(Zend_Registry::get(‘config’)->session->nameSpace); $this->session->showBox = 0;

  • 0

Sample code :

jQuery(function() {
    jQuery('#changePwYes').click(function(){
        <?php 
            $this->session = new Zend_Session_Namespace(Zend_Registry::get('config')->session->nameSpace);
            $this->session->showBox = "0";
        ?>
    });

});

This php script should be executed only when button clicked but executing while loading itself.

What to do

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T13:17:35+00:00Added an answer on June 17, 2026 at 1:17 pm

    In such case, when you want to make some changes on server side from client side without page redirection, we have AJAX.

    Call a Zend controller action from your click event trough AJAX :

    jQuery(function() {
        jQuery('#changePwYes').click(function(){
            $.ajax({
             url: "myApp/public/index.php/controller-name/create-name-space/format/html",
             type: "POST",
             data:{mydata : 'test'}
             success: function(html){   
                alert('Done');    
             },
             error: function(jqXHR, textStatus, errorThrown){       
                alert('An error occurred);
             }
            });
        });
    });
    

    In your controller, create a new action :

    public function createNameSpaceAction()
    {       
        //Disable the layout rendering for the ajax request
        $this->_helper->layout->disableLayout();
        //Set no renderer in this case
        $this->_helper->viewRenderer->setNoRender(true);    
    
        //Retrieve dada if needed
        $myData = $_POST['mydata'];
    
        $session = new Zend_Session_Namespace(Zend_Registry::get('config')->session->nameSpace);
        $session->showBox = "0";    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

im new to jquery and javascript.. Here is the code, this is a sample,
Sample code: <div id=a> <div id=b> Click here </div> </div> <script> $('*').click(function() { alert($(this).attr('id'));
I have pretty simple jquery code : $(document).ready(function(){ $('img.marqFl').on({ mouseenter: function() { $(this).animate({height: 300},
I'm using the simple jQuery DIV refresh code. var refreshId = setInterval(function() { $('#refreshdash').load('dashboard.php?cache=');
Trying to get comfortable with jQuery and I have encountered some sample code that
Another jquery calculation question. I've this, which is sample code from the plugin site
How to get the first child id inside the div using JQuery. Sample code:
Hi I have this sample code to load random quotes. PHP Code: <?php //Selecting
This is my sample code. The select function is not working. What I'm doing
Is this jQuery code (function(jQuery){ })(jQuery); equivalent to $(document).ready(function () { }); If yes,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.