Solved

Javascript / HTML Error?

Posted on 2015-02-17
3
70 Views
Last Modified: 2015-02-17
See attached.

Note the values of error and resp_code.

Note the alter on line 20.

The alert shows http://www.rain1.com/new-site/review-and-pay/ as the value, not what it was set to on line 13.

Why?
test.html
0
Comment
Question by:Richard Korts
3 Comments
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 40614896
0
 
LVL 44

Accepted Solution

by:
Rainer Jeschor earned 500 total points
ID: 40614985
Hi,
because in the moment the script is run, the form does not yet exist, hence you get an "Undefined" error (e.g. just Chrome and the Developer extensions) when the following line is run:
document.st.captchae.value = "N";

Open in new window

So when you run this kind of script within the header, the DOM (where also the form is part of) is not yet loaded / available.
HTH
Rainer
0
 

Author Closing Comment

by:Richard Korts
ID: 40615267
I thought of just that as I was driving to the Dentist.

Thanks!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now