Jump to content

Ajax bugs I can't seem to fix


ephemeral

Recommended Posts

I'm having two Ajax-related problems on a page I am working on at the moment. You can see it here: http://www.utm.edu/departments/acadpro/library/openmic/add2db.php

 

On this page, I have two buttons that use Ajax to fetch two separate forms and put them into a chosen div; that part works like a charm.

 

On said forms, there is a div that is meant to display any necessary error messages when the submit button is clicked. However, on the first time the page is visited and the form is chosen, the div won't display the error message. Only after refreshing the page/choosing the form a second time will the message show. I've been checking the response from the server via Firebug and the response is correct, it just seems like the page isn't updating correctly.

 

Secondly, once I refresh or choose the form again and the error message begins to show, if I enter values into the form fields and should be getting a different error message, it never updates. Once again, the server response is correct, but for some reason the page just isn't updating to reflect the new message.

 

I have been using the date field on the New Event form for testing; if you have Firebug, you should be able to see that I am getting the desired response from the server, but the HTML isn't changing with it. I have tried both using my own Ajax functions and using jQuery's Ajax implementation, but both give me the same problems. What am I doing wrong?

 

(PS - The code spans over two files -- http://www.utm.edu/departments/acadpro/library/openmic/add2db.php and http://www.utm.edu/departments/acadpro/library/openmic/js/add2db.js -- so unless someone wants to see it posted here, I won't include the large code blocks. The files are live at the urls, and are attached in a zipped folder. )

 

[attachment deleted by admin]

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.