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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T14:21:03+00:00 2026-06-03T14:21:03+00:00

I’m using cakephp 2.1 just fine; I want to use jquery to have my

  • 0

I’m using cakephp 2.1 just fine; I want to use jquery to have my form divided by tabs.
Already used jquery outside cake and got the tabs demo working. http://jqueryui.com/demos/tabs/
I’ve also made jquery available to cakephp from webroot folder and

ProjectsController.php

public $helpers = array('Js' => array('Jquery'));

add.ctp (at the very last line)

echo $this->Js->writeBuffer(); // Write cached scripts

Where and how should I invoke jquery in my view? I know I shoud use something similar to the demo:

<script>
        $(function() {
            $( "#tabs" ).tabs();
        });
    </script>

But don’t know where in my view to do it and the sintax.

Can anyone help?

Thanks a lot !

This if my full add.ctp

<div class="projects form">
<?php echo $this->Form->create('Project');?>

<fieldset>
    <legend><?php echo __('Add Project'); ?></legend>
<?php
            $arr_pr_subject = Configure::read('AR_SUBJECT'); 
            $arr_pr_status = Configure::read('AR_STATUS'); 
            $arr_pr_payment = Configure::read('AR_PAYMENT'); 
            $arr_pr_country = Configure::read('AR_COUNTRY'); 
            echo $this->Form->input('name', array('label' => 'Name:'));
            echo $this->Form->input('pr_subject', array('label' => 'Subject:', 'options' => $arr_pr_subject));
            echo $this->Form->input('pr_country', array('label' => 'Country:', 'options' => $arr_pr_country));
            echo $this->Form->input('pr_number', array('label' => 'ASC Project Number:'));
            echo $this->Form->input('pr_status', array('label' => 'Status:', 'options' => $arr_pr_status));
            echo $this->Form->input('client_id', array('label' => 'Client:', 'options' => $clients));
            echo $this->Form->input('pr_client_number', array('label' => 'Client Project Number:'));
            echo $this->Form->input('exec_id', array('label' => 'Sales Executive:', 'options' => $execs));
            echo $this->Form->input('pr_start', array('label' => 'Est. Start Date:'));
            echo $this->Form->input('pr_end', array('label' => 'Est. End Date:'));
            echo $this->Form->input('pr_notes', array('label' => 'Notes:'));
            echo $this->Form->input('pr_payment', array('label' => 'Payment options:', 'options' => $arr_pr_payment));
?>
</fieldset>
<?php echo $this->Form->end(__('Submit'));?>
</div>
<?php
echo $this->Js->writeBuffer(); // Write cached scripts
?>
  • 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-03T14:21:05+00:00Added an answer on June 3, 2026 at 2:21 pm

    In your <head>, include jquery and jqueryui:

    <script src="/js/path/to/jquery.js" type="text/javascript"></script>
    <script src="/js/path/to/jqueryui.js" type="text/javascript"></script>
    

    Then right under that, include a separate js file to keep all your code in

    <script src="/js/myscripts.js" type="text/javascript"></script>

    In that file (myscripts.js) put in your jQuery code:

    $(function() {
      $( "#tabs" ).tabs();
    });
    

    Then structure your form input to match jQuery Tabs syntax

    <form action="...">
    <div id="tabs">
      <ul>
        <li><a href="#tab1">Tab 1</a></li>
        <li><a href="#tab2">Tab 2</a></li>
      </ul>
      <div id="tab1">
        <!-- Tab 1 inputs in here -->
      </div>
      <div id="tab2">
        <!-- Tab 2 inputs here -->
      </div>
    </div>
    </form>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just tried to save a simple *.rtf file with some websites and
I have a jquery bug and I've been looking for hours now, I can't
I am reading a book about Javascript and jQuery and using one of the
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I want use html5's new tag to play a wav file (currently only supported
I have a French site that I want to parse, but am running into
I have a text area in my form which accepts all possible characters from
I have thousands of HTML files to process using Groovy/Java and I need to
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has

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.