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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:29:40+00:00 2026-05-26T00:29:40+00:00

These are the buttons on my form: <input type=submit id=form-submit class=btn name=save value=verzenden />

  • 0

These are the buttons on my form:

<input type="submit" id="form-submit" class="btn" name="save" value="verzenden" />
<input type="submit" name="cancel" class="btn" value="annuleren" />

I catch the cancel click with php like this:

if($_POST['cancel'])
{
    Helper::redirect('page.php');
}

But before I submit my form, I use some jQuery to validate the form, now I can’t click cancel because it will validate first.

This is my jQuery code:

<script type="text/javascript">

    $(document).ready(function(){ 
        $('#cancel').delegate('','click change',function(){
            console.log('test');
        });

        $('form').submit(function(){
            var proceed = true;

            $('.required').each(function(){
                if ($(this).val() == '' || $(this).val() == 0 || $(this).val() == '0') {
                    $(this).css('border-color', '#F00');
                    proceed = false;
                }
                else {
                    $(this).css('border-color', '#999');
                }
            });


            return proceed;
        });

        // Check on typing if a required field is empty
        $('.required').keyup(function(){
            if ($(this).val() == '' || $(this).val() == 0 || $(this).val() == '0' ) 
                $(this).css('border-color', '#F00');
            else 
                $(this).css('border-color', '#999');
        }); 
    });
</script>

How can I ignore the jQuery and redirect to page.php when I hit cancel?
Thanks

  • 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-26T00:29:41+00:00Added an answer on May 26, 2026 at 12:29 am

    This is what I got now:
    Thanks ThiefMaster

    //javascript

    $('#cancel').delegate('','click change',function(){
        window.location = "testimonials.php";
        return false;
    });
    

    //php

    if($_POST['cancel'])
    {
        Helper::redirect('testimonials.php');
    }
    

    //html

    <input name="cancel" type="submit" id="cancel" class="btn" value="annuleren" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following HTML <form id=create_form name=create_form action= method=post> <input name=type id=type value=individuel
I have a a form: <form id=deletesubmit style=display:inline > <input style=width:50px type=text id=delcustomerid name=delcustomerid
I have this form: <form name=form method=post> <div> <p> Problem Name: <input type=text size=20
I want to use a form that has two submit buttons. Each button calls
We have a form which has a few separate submit buttons which do different
<table class=tableData id=addUserTable > <tr> <th class = name=errorMsgUser id=errorMsg value= colspan=2>&nbsp;</th> </tr> <tr>
$('#submit').click(function () { //Get the data from all the fields var name = $('input[name=name]');
Is there a way I can tell how many times a form submit button
i have custom cell with 2 buttons(the function of these buttons is just to
I have a big table containing a button in each cell. These buttons are

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.