Strange issue when calling LocalSearchService V3 using Form Input

Hey All -

I'm stuck on an issue and hoping you all might be able to help me out or give me some ideas.  The basic idea behind my code is to have a form that collects some info from the user, on submit pass that info on to the yahoo local search api, and then parse and display the results on the page.  Shouldn't be difficult and I have it almost working...

Here is the workflow:

1. User enters info in the web page form
2. User selects Submit button and onsubmit a callApi() function is called.
3. The callApi() function uses the form data to create and then send an xmlhttprequest object to the yahoo api
4.  When the xmlhttprequest object readyState == 4 && status == 200 then call the handlerequest function.
5. The handlerequest function would parse the results, create and populate a Div element in the page body.

All of the above steps work when I step through the code using firebug, the page even populates on step 5 but when after step five when the focus returns to the onsubmit function call the page clears!?!?  I don't know if its something when how the page is being loaded or what.

If I change the original call to an onclick button so that if a user selects the onclick button the callApi() function is called, everything works great and the results are displayed and only clear when the button is selected again. 

Has anyone encountered this issue??  I didn't post the code but I can if need be.... 

Thanks in advance,


0 Replies
This forum is locked.

Recent Posts

in Local API - General Questions