Hide the first and last pages of the get quote process.
This function will hide the first and last pages of the get quote process for broker schemes. The first page asks if the user wishes to log on or select an existing client and the last page asks for confirmation of the client details. Most of our schemes do not require these pages so we validate then hide them if they are complete.
In order to activate these functions you will need to add a listener (Code available under a separate article):
function Clientdetails(){
//Check if there is a label warning
var titleElement = $('ctl00_MainContent_UserTitle');
var atitle= findLableForControl(titleElement);
var surnameElement = $('ctl00_MainContent_Surname');
var surname= findLableForControl(surnameElement );
var firstnameElement = $('ctl00_MainContent_Firstname');
var firstname = findLableForControl(firstnameElement);
var isError = firstname.innerHTML + atitle.innerHTML + surname.innerHTML
if (isError.length == 0) {
document.forms["aspnetForm"].hide();
var nextButton = $('Next');
nextButton.click();
}
}
//Finds a label attached to an Element
function findLableForControl(el) {
var idVal = el.id;
labels = document.getElementsByTagName('label');
for( var i = 0; i < labels.length; i++ ) {
if (labels[i].htmlFor == idVal)
return labels[i];
}
}
Hope this works for you.
Please sign in to leave a comment.
Comments
0 comments