If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

[RESOLVED] Javascript reloading page, or crashing, don't know why

(warning long post, sorry)

I'm pretty new at PHP-Ajax but I've worked my way way around it so far.. until now....

I'm trying to display content dynamically in a DIV

My Script is a merge of two other scripts I found online one function (showUser) uses a GET method and the other (funcionPost) uses a POST method independently they work like a charm, but combined in the same script they throw some issues.

*click on drop down menu and select option 1 that uses showUser function*

Entro a showUser con str="+str // Enters to showUser function where str is the value selected from the drop down menu, in this case 1.
Sale de showUser //exits showUser function, displays form in DIV with id "txtSalida"
*I fill out the form and press the submit button, the idea is to show a preview of the input data for confirmation, the preview DIV is called "txtVP"*

*In the fourth iteration it will display the information correctly in the txtVP DIV, my gues is that it takes 4 times because of the readyState, but that's just my guess*

Server response ~ if (xmlhttp.readyState==4 && xmlhttp.status==200)
*So far I would be happy with the results, since it actually displays stuff in the way I like it... regardles of the 3 previous error iterations... but then... it iterates one more time..dunno why...*

Without the alerts to track every move... everything happens in fractions of second.. due to tracking I was able to determine that it actually displays the info correctly, BUT then reloads the whole thing...

I know it's a lot to ask..... but i'm feeling hopeless here and perhaps you can see the error more evidently than me....

I would appreciate greatly your help...
or even if you just took the time to read all this... I'm in gratitude...

thank you in advance and looking forward to your questions, comments or replies

or
I understand that libraries like jquery do the ajax handling, POST and GET methods, do I need to install something on the server-side? should I go with this option? I feel i-m pretty close to get the results I want.. I just need to figure out why my page reloads at the end...

It still alerts me 3 times of AJAX call error before displaying the correct response text.. perhaps I should just disable that else sentence.. but i-m afraid there's a deper meaning to that error... dont want to leave it just like that!