Hi there,
I have a web form that is built in notes and it has an embedded javascript library which handles the validation.
If a field is empty it puts focus on the first empty field in the list of ‘empty fields’ returned by the validation code.
This worked fine until i added a tab and two divs which alternate being hidden or shown on the form based on which tab you click.
Now if i am on the second tab which is where the validation button is and the field that is empty is on the first tab the code fails because it cannot find the field to focus on.
This is a problem i am familiar with in the lotus notes client so i thought i would have a crack at fixing it myself ![]()
I also have a small function in the js header of the lotus notes form which swaps the two divs around. Here is the code for that
function toggleLayer(showLayer, hideLayer){
showDiv = document.getElementById(showLayer);
hideDiv = document.getElementById(hideLayer)
showDiv.style.display=“block”;
hideDiv.style.display=“none”;
}
I copied this function into the javascript library so i could call it from there. Now what i do is pass in which tab the field for validation is on and when a field fails validation i call this function to switch the required tab to visible and hide the other. then when the focus to the field is set by the validation code it should work…
The code doesn’t error but i need to somehow refresh the page so that it acts out the switch of DIV in the ui.
Putting location.reload didnt work, when i tried to switch to the second tab it was somehow running this command in my validation code and kept refreshing the page back to the first div.
I hope this makes sense. But i am trying to find the method to get this to work. This is my first web project in Lotus Notes, and out of lotus notes, so any help would be greatly appreciated.
Stephen (too scared to take R7 web developer exam)