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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T04:38:01+00:00 2026-06-12T04:38:01+00:00

I have some problems to run the following code, the js: $(document).ready(function(){ $.validator.addMethod(name, function(value,

  • 0

I have some problems to run the following code, the js:

 $(document).ready(function(){
$.validator.addMethod("name", function(value, element) {
    return $("#identiPIC_selected_0").val() !== '' &&    $("#identiPIC_selected_1").val() !== '' ;
}, "Required!");

$("#signin").validate({
    groups:{
         name : 'identiPIC_selected[]'  
    },
    rules: {
        'identiPIC_selected[]': {
            required: true,
            remote: { 
                url:"check3.php",
                type:"post",
                cache: false,
                async:false,
                data: {
                    'identiPIC_selected[0]': function() {
                        return $.trim($("#identiPIC_selected_0").val());
                    },
                    'identiPIC_selected[1]': function() {
                        return $.trim($("#identiPIC_selected_1").val());
                    }
                }
            }
        }
    }
});

});

the php is the following:

<?php
 $captcha = $_POST['identiPIC_selected'];
$identiPIC[0] = "Apple";
$identiPIC[1] = "Flower";
 if($captcha === $identiPIC){
    echo "true";
 } else {
    echo "false";
 }

?>

and the html:

<form id="signin" action="check3.php" method="POST">
<select id="identiPIC_selected_0" name="identiPIC_selected[]">
<option value="">Click to identify</option>
<option>Apple</option>
<option>Cat</option>
<option>Clock</option>
<option>Flower</option>
<option>Fork</option>
</select>
<select id="identiPIC_selected_1" name="identiPIC_selected[]">
<option value="">Click to identify</option>
<option>Apple</option>
<option>Cat</option>
<option>Clock</option>
<option>Flower</option>
<option>Fork</option>
</select>
<input type="submit" id="save" name="save" value="Save"/>
</form>

This code works well when, except when the user selects the second “select” option wrong, presses submit and then fixes his mistake and then he presses submit it just doesnt submit anymore, so what i mean is for example:

User selects: Apple + Cat and click on save button, displays error,
User fixes the problem: Apple + Flower and click on save button, it doesnt submit, even all the picks are good.

I added this :

$("#identiPIC_selected_0").change(function () {
    $("#identiPIC_selected_0").removeData("previousValue");
});
$("#identiPIC_selected_1").change(function () {
   $("#identiPIC_selected_1").removeData("previousValue");
});

but it doesnt seem to do anything for me.
Anyone any ideas?
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-06-12T04:38:03+00:00Added an answer on June 12, 2026 at 4:38 am

    ok… after different tries i think i found the solution, this seems to work:

       $('#signin').submit(function(){
        $("#identiPIC_selected_0").removeData('previousValue');
        $("#identiPIC_selected_1").removeData('previousValue');
    })
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code, and am having some problems with it. Any help
I'm just starting to learn Xcode, and have run in to some problems... I've
I have some code that I'd like to run on a page. My problem
I have some problems with header() function. It works and doesn't work at the
i have some problems with rowspan: var doc1 = new Document(); doc1.SetPageSize(PageSize.A4.Rotate()); string path
I have some problems with my script below, I am getting the following warnings,
I'm currently making a webpage and I have run in to some problems with
I have the following VBA code Private Sub CreateQuery_Click() Dim doc As Document Dim
I'm having some problems with the following code: private class ClientPluginLoader : MarshalByRefObject {
I have been using the following code for quite some testing now and havent

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.