captcha - Update 2 exact same images source using javascript -


i using php captcha called cryptographer captchan.fr site

i need use 2 captcha on same page have problem generated when click refresh first 1 refreshes, refresh code looks this.

document.images.captcha.src='cryptographp.html?cfg=0&&'+math.round(math.random(0)*1000)+1; 

i tried code works first 1 anyway

document.getelementbyid('captcha').src='cryptographp.html?cfg=0&&'+math.round(math.random(0)*1000)+1; 

now wanted added name="captcha" image not work reason can me fix it?

document.getelementsbyname('captcha').src='cryptographp.html?cfg=0&&+math.round(math.random(0)*1000)+1; 

i have jquery attached page if thats easier.

you can't have more 1 element same id on page. may why it's hitting first one. if add class both images called "captcha" can jquery:

$('.captcha').attr('src', 'cryptographp.html?cfg=0&&'+math.round(math.random(0)*1000)+1); 

Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -