![]() |
listener not working
Im not sure whats up with the listener but the function is not working and i cant seem to find out whats wrong.
my other function works fine but when i paste this into the functions area (i dont even call it yet) then the other functions stop, so it seems that maybe there is something broke here. Code:
Code:
Code:
a couple of points, the test for email_availablilty works fine, i tested it with direct url and with url vars and that file works fine. im not an ajax person so i dont understand why im not getting the silent process being executed. When i remove the tog_email function and the rest of the on change httprequest stuff and call the settextflag() direct, then it works, when i change the field value for hiddenemail then the other input changes to a "p" but then when i add the tog_email and other httprequest stuff back (and not even call it) nothing works. |
url+"?nemail="+nemail"&neid="+neid;
should be url+"?nemail="+nemail+"&neid="+neid; |
Thanks so much, i was just looking at that this morning and nice catch, its always good to have other eyes look sometime. Thanks
|
i thought this was resolved but its not. its not grabbing the echo display and giving me a 200 or a readystate 4 and everything else works, the php display correctly,
i can do a test with just this in the function and it works fine Code:
document.getElementById('emailswitch').value="p";here is the new function, i decided not to pass the vars from the onchange but just to load them in the function. Code:
The only thing i can think of is maybe the url is messed up but i dont know how to echo the url var so i can see it when i execute the function. |
You should encode the email and id before attaching them to the url:
Code:
var nemail = document.getElementById('hiddenemail'); |
yeah that function was left over from the old code that split up the request into different functions. removed it and I am getting feedback now.
do i even need to set it to null and then check it, im guessing if i do then i need to do it after it checks the dif browser commands right. Code:
|
You could try this:
Code:
function getAjax() {Added: great page here! |
Previously I would receive a status of 0 (rather than 200) when testing locally. This no longer seems to be the case but it might be worth changing it from 200 to 0 temporarily just to exclude this possibility.
|
yeah its an input but had value="" but i took off the value property because i figured it would be set by the function only since thats the only way i want to set that
I used it for testing to make sure when i was getting execution or not. Since i have the div working now i dont know if i still need that, so i might remove that or comment it out for testing later if i need it. Thats great thanks, i had seen the old code before in another file but didnt know what it was or how it worked, this has been a learning experience and thats a good thing, now i know another way to do things and i like learning, i just wish i would not stay up all night doing so lol... thanks sooooooooooooo much for helping me learn... yeah the old code did not even have 200 in there it just checked for readystatus 4 is that ok? |
Code:
|
Quote:
Ta @DaveyErwin |
Just wanted to follow up to say (for those that want value and not element) that you need to tweek that alittle and add .value attribute to get the value because it defaults to the element. All i did was did an alert until i got the value i wanted, thats the easiest way i think. I am not that far along after that i think i will have to prob use a diff output also to the div but not sure im not there yet.
|
Hi another follow up, i did finally get it working after several hours of tweeking.
Now that i know how to test and work the process a bit, next time will go faster. Today was a learning curve. Anyway i wanted to let you know that not to use the else on the status values. This is what im talking about. Code:
The reason i found is that it will keep popping up that message several times until it finishes and gets the right status code. So if you just comment it out, you will just see the final result on the page and not have to sit there and keep clicking to close the multiple alerts. |
| All times are GMT +1. The time now is 03:15 PM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.