May want a fresh cup of coffee for this post as it is somewhat wordy:
Setup (Notes form):
-
Web Only.
-
Form contains a
on the form (not a page). -
The CSS (internal for now, will eventually end up in a file) hides the DIV section via:
-
Form also contains a link which calls a Javascript function to display the password section when clicked. This is accomplished by:
document.getElementById('changepassword').style.visibility = "visible"; document.getElementById('changepassword').style.display = "block";
The function works and the password “section” is now viewable/editable on the browser.
-
There is a Notes field called HTTPPassword within that div.
-
The idea behind all this is to allow users to click on a link, display a section where they can enter in a new password, and then submit it. There is a different link that the user clicks to (1) validate the password and then (2) submit the form.
Problem:
I am having issues with the getElementById to access a div’s content on a form (not a page). Firefox generates a javascript error when running the following code:
alert(‘POS’) ;
var passwordelement = document.getElementById(‘HTTPPassword’) ;
alert('passwordelement → ’ + passwordelement.value );
The first alert displays, and then the second one. However, there is no value displayed for the: passwordelement.value. This code is present in the Javascript function that is called when the user attempts to save the form.
The error in Firefox is:
Error: passwordelement has no properties and code stops executing
In IE 6.0, it also does not have a value either but IE allows the code to continue executing.
It seems the form tag generated by Domino is causing the issue. I took some html code that wasn’t working when served up by Domino and created an HTML file and placed it in the HTML directory. The getelementbyid worked as expected. Pasting that same code into a form would stop working. When I added a at the top of the form, the getelementbyid would work as expected.
HOWEVER, the code which displays the password section, i.e., document.getElementById(‘changepassword’).style.visibility = “visible”; works as expected without inserting the . The link that runs that code is within a DIV itself, although that DIV is not “hidden” via CSS or Notes
Any ideas?
Caveats:
-
No, I don’t want to use a Domino refresh
-
No, I don’t want a pop up window
thnx,