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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T19:13:07+00:00 2026-05-27T19:13:07+00:00

I am using cakephp 1.3 and fancybox..I have managed to put a form in

  • 0

I am using cakephp 1.3 and fancybox..I have managed to put a form in fancybox.Now i want to focus cursor into the one of the input field. I am pretty tired of trying many thing.My code given below

<script type="text/javascript">
jQuery(document).ready( function() {
//document.getElementById('frmname.answer').focus(); 
jQuery("a#answer").fancybox({
        'transitionIn'  :   'elastic',
        'transitionOut' :   'elastic',
        'speedIn'    :  600, 
        'speedOut'   :  200, 
        'overlayShow'   :   false,
        'href'  : this.href,
});

}); /* */
</script>

I tried following things

'onComplete' : function() {
               $('#fancybox-frame').contents().find('#answer').focus();
            },

and

$('#answer').focus();

in my script.But no good result>can any one point out the wrong i am doing with my code.Thanks in advance.

My fancybox content is like this:

<div style='display:none'>
    <div id='reply'>

        <h1>Reply For <?php echo $offer['OfferBoard']['headline'] ?></h1>


        <ul class="nrml_list" > 

                <?php echo $this->Form->create('OfferAnswer',array('id'=>'frm','name'=>'frmname'), array('action' => 'reply/'.$offer['OfferBoard']['id'],'inputDefaults'=> array('label'=>false))); ?>


                <li> 
                    <div class='ulabel' style="float:right;" >Reply Text</div>
                    <div>
                        <div class="left"><?php echo $form->textarea('answer',array('class'=>'tarea1','label'=>FALSE,'id'=>'answer')); ?></div>
                        <div class="clear"></div>
                        </div>  
                </li>

                <li> 
                    <div class='ulabel' ></div>
                    <div>
                        <div class="left"><?php 
                                $attributes=array('type'=>'checkbox','div'=>false,'value' => '1','hiddenField' => false,'label'=>FALSE);
                                echo $this->Form->input('copy_to',$attributes)." Send Copy ";  
                        ?></div>
                        <div class="clear"></div>
                        </div>  
                </li>



        </ul>
            <?php echo $this->Form->end('Reply'); ?>



    </div>
  • 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-05-27T19:13:07+00:00Added an answer on May 27, 2026 at 7:13 pm

    Try:

    //without quotes in onComplete, this worked for me
    onComplete: function() {
       $('#answer').focus();
    },
    
    

    Hope it helps

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using cakephp, I have a generic address table, which I want to link to
I'm using CakePHP for a small web app and on one form page there's
Using CakePHP 1.3 we have a booking system for hotel rooms. A check-availability form
Using CakePHP: I have a many-to-one relationship, let's pretend it's many Leafs to Trees.
Using CakePHP 1.3 , I have a (working) form that has dynamically created form
I am using cakephp framework to build my application. I want that, whenever a
I am using CakePHP framework with MySQL database and I have problem in saving
I'm using CakePHP but it's a question about the MVC pattern. I have in
I just started using CakePHP for a small project. I have rails experience, and
I am working on a CMS using CakePHP and I want to create a

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.