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 8272657
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T07:12:09+00:00 2026-06-08T07:12:09+00:00

I stuck in a situation. I am using JS Helper. I used the following

  • 0

I stuck in a situation. I am using JS Helper. I used the following code.

<?php $this->Js->get('#client_id')
        ->event('change', $this->Js->request(array('action' => '../ajax/get_client_location_and_process'),
                   array('update' => '#client_location_process',
                     'async' => false, 
                     'dataExpression' => true,
                     'method' => 'post',
                     'evalScripts' => true,
                     'data' => $this->Js->serializeForm(array('isForm' => True, 'inline' => True))
                     )
                   )
        );

I want to trigger the change event on page load. If I am using document.ready method then it is not working. and I unable to find the JS Helper method where we can explicitly trigger some event on controls. Please suggest the code how can I perform JQuery trigger() like functionality on form elements whenever I need it.

  • 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-08T07:12:11+00:00Added an answer on June 8, 2026 at 7:12 am

    Since you already found out about .trigger() in jQuery, you can just use it along with your view code:

    <?php 
        // Your view code
    ?>
    <script>$('#client_id').trigger('change');</script>
    

    Alternatively, if you still prefer to do it via PHP, you can perhaps make your own helper, eg.:

    <?php 
    class ArunjsHelper extends AppHelper {
        public $helpers = array('Html');
    
        function trigger($element, $event, $options = array()) {
            return $this->Html->scriptBlock("$('$element').trigger('$event');");
        }
    }
    

    Add ArunjsHelper to $helpers at controller:

    <?php
    class SomeController extends Controller {
        public $helpers = array('Arunjs');
    
        // Your controller code
    }
    

    You can then call it from view:

    <h1>Hello</h1>
    <p>Your usual view HTML code</p>
    
    <?php // Trigger the change event ?>
    <?php echo $this->Arunjs->trigger('#client_id', 'change'); ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Answering to this question I stuck with this situation. Using reluctant match in my
I'm using jquery plugin tablesorter and I'm stuck with the following situation: my grid
I'm using ASP.NET MVC 2 and stuck with the situation when needed to store
Have been getting pretty bald over this situation! I am using MS VS 2010
I am developing a Diary Management Script using PHP and MySQL. I am stuck
Consider the following situation. I have 3 tables in a resource planning project(created using
I'm stuck with a LINQ group by situation trying to solve it without using
We are using Hibernate Envers and have the following situation: A class BusinessObjectType and
I have a quite strange situation. I have this very simple package: Task get
I am stuck in a situation from which I am finding no solution. Let

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.