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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T17:36:33+00:00 2026-06-17T17:36:33+00:00

In my web application(using Zend Framework) when adding a new entity to the database,

  • 0

In my web application(using Zend Framework) when adding a new entity to the database, it should check whether this entity has previously been added and deleted. (When deleting an entity from the database, that particular record’s “STATUS” column is updated to 0(zero).)

If the entity has deleted earlier, the system asks for confirmation to edit the previously deleted record, or add a new record. If the user needs to edit the previously added record, user should be redirected to the edit page.

This check and redirecting is done using jQuery. Here is the jQuery code I’m using:

 $("input[name=btnSubmit]").click(function(){       

    var name = $("input[name=txtTblPrefix]").val();
        var parameters = 'name='+name;

        $.ajax({
            url: '../admin_mapping/get-id',
            async:false,
            data:parameters,
            type:'POST',
            dataType: 'text',
            success: function(data)
            {       
                var res = confirm("There is a record already added to the database for "+name+". Do you want to edit it?");

                if(res)
                {
                    window.location.replace("../admin_mapping/edit?id="+data);
                }
            }

        });

    });

In this code, everything works perfectly other than the redirecting. I have tested the line window.location.replace("../admin_mapping/edit?id="+data); separately and it works fine. Even the confirm() function returns true.

I have tried putting an alert() inside the if condition, and the alert prompts. But the redirecting is not working.

Can anyone please help me with this?

Thanks in advance

  • 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-17T17:36:35+00:00Added an answer on June 17, 2026 at 5:36 pm

    The only thing I need to do is put a return false inside the submit function. Otherwise as the button is a submit button, the form gets submitted.

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

Sidebar

Related Questions

All, I have a PHP Web application built using Zend Framework and MVC with
I'm building a web application using PHP5.3 and Zend Framework 1.9.4. i have an
I'm using Zend Framework and MySql to create my web-application. My SQL-code is the
I am developing a web application using zend framework. For select statements I have
I have a Zend Framework (PHP) web application that has a table with a
I'm currently building a web application using Zend framework 1.11.11 and Doctrine 2.2. I
Currently I'm develping a web application using Zend framework. My problem is that I
I'm using Zend-Framework 1.9.5 to make a web-application, But it's Url_Helper was quite tricky
I'm using PHP Zend framework for my web application. When users register, I send
I am developing a web application with Zend Framework, and I am using JQuery

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.