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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:42:48+00:00 2026-05-25T23:42:48+00:00

i have a Zend Form and i would like to use jquery to do

  • 0

i have a Zend Form and i would like to use jquery to do some ajax posting.

if ($this->getRequest()->isPost()) {
$data = $form->getValues();
$image_id = $this->usermedia->crop_image($userObj->user_id, $data);
}

the crop_image saves the data:

$new_image_id = $this->getDbTable()->createRow($new_row_data)->save();
return $new_image_id;

if the form is posted then run a function and give me back an $new_image_id.

all this happens in a modal window that loads a iframe with the form.

what i want is when i submit the form to grab that $new_image_id from inside the iframe, close the modal window and place it on my original page

any ideas on how this can be done?

thanks

edit:

  • 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-25T23:42:48+00:00Added an answer on May 25, 2026 at 11:42 pm

    Just render that variable into a javascript variable:

    var newImageId = "<?php echo $new_image_id ?>";
    

    Then you can use:

    http://api.jquery.com/load/

    jQuery’s wonderful .load() method to send that id to an external PHP page that then pulls it from the database and renders it to HTML. .load() will pull that all back in to your current page. You can then define a callback from .load() which gets rid of the modal.

    Edit:

    If your code is such that rendering the variable to a javascript variable is not practical, you can render it to the DOM itself, say as an element attribute… then get it using .content()

    jQuery/JavaScript: accessing contents of an iframe

    Bear in mind same origin policy:

    http://en.wikipedia.org/wiki/Same_origin_policy

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

Sidebar

Related Questions

When I use the zend CLI to create a form, like this, a form
I have the Zend Form with some elements. And I need to placing some
I am working on zend. I have a form with some checkboxes. I want
I would like to have a form that gets output into a table. The
I have a form and I would like to customise the markup for it.
I have a form that contains and form of which code goes like this
I have a zend form with some elements. I want to have some dynamic
I have an auth module, and would like to keep a Login form in
We have 3 websites running on Yii and Zend frameworks and we would like
We have a form that submits data to various Google Spreadsheets using Zend Gdata.

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.