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

  • Home
  • SEARCH
  • 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 4617210
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T02:05:33+00:00 2026-05-22T02:05:33+00:00

I have been reading around and know that by default jQuery within a the

  • 0

I have been reading around and know that by default jQuery within a the returned html by default does work, but also read that setting the dataType in the ajax requet to “html” shoudl evaluate the jQuery, however it doesn’t seem to be doing that.

<script type="text/javascript">
    $(document).ready(function(){
        $('.calendarsubmit').remove();
        $('select[name=typetest]').change(function(){
            var url = '/<?=$eventurlstart?>/'+escape(this.options[this.selectedIndex].value)+'/<?=$mnth?>/<?=$yr?>';
            location.href=url;
        });
        $('select[name=month]').change(function(){
            var url = '/<?=$eventurlstart?>/<?=$type?>/'+escape(this.options[this.selectedIndex].value)+'/<?=$yr?>';
            location.href=url;
        });
        $('select[name=year]').change(function(){
            var url = '/<?=$eventurlstart?>/<?=$type?>/<?=$mnth?>/'+escape(this.options[this.selectedIndex].value);
            location.href=url;
        });
    });
</script>

That is the code that is loaded with the HTML from the page. How do I execute this?

Thanks.

EDIT:

Using live change seems to work:

$('select[name=typetest]').live('change',function(){

The issue I am having now is the .remove(). With or without document ready, it doesn’t get called through Ajax.

EDIT 2:

Although the live works, more ajax following, I need a way to update that live function each time the page is called.

EDIT 3:

I just called unbind before recreating the live function, which works great. As for the remove function, I had to add it to the end of my page. Even though it was right after the element, it seemed to get called too soon, so the element wasn’t removed. Moving it down made it get removed perfectly.

Thanks everyone that helped get me to this solution.

EDIT 4:

This actually didn’t work. Not sure what happened. Anyways, what I ended up doing is using the live function and having it read the other forms values in jQuery rather than do it via PHP. Still working on the remove issue.

  • 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-22T02:05:33+00:00Added an answer on May 22, 2026 at 2:05 am

    Well, $(document).ready doesn’t fire until the HTML is completely parsed, and by that time the AJAX request is over. So it’s parsing the javascript, it just doesn’t do anything because the event it’s attached to isn’t firing.

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

Sidebar

Related Questions

I have been reading around for other answers but i am still not understanding
I have been reading lots of articles and also questions here on SO but
I have been reading up on this, and it seems that if you use
I have been reading up on multiple PHP frameworks, especially the Zend Framework but
Its been a long time since I have programmed in C++, but I know
I'm new to C# and .NET, ,and have been reading around about it. I
Have been reading around on IErrorHandler and want to go the config route. so,
I have been reading these forums for some time, but this is my first
I'm new to AutoMapper and I've been reading and reading questions around here but
I have done a fair bit of searching and reading around but haven't found

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.