Forums

validate form fields inside a tab before going to next tab

am_soumya 19 Dec, 2012
Hello,

I have a form with three tabs. Each tab has more than one fields and one Save to Continue button for jumping to next tabs. Save to Continue is a normal button, it doesnot save the details entered to database. Following is the code for button:

<div class="to_tabs" ><input type="button" class="to_tab savebtn" value="Save & Continue" name="about" id="1"></div>

Put a load JS action on onload event and inserted following code make these button jumbp in between tabs:

window.addEvent('domready', function() {
$$('div.to_tabs input').each(function(el) {
el.addEvent('click', goTab);
});
});


function goTab(){
pane = $('#cf_tabbed_form dl')[0].retrieve('JTabs');
pane.display(this.getProperty('id'));
}



I want to put validation in each tab itself, it should display error message when I jump to next element itself or when I click on Save and Continue button of each tab. That is it should restrict the user to get next tab, if any field inside the current tab have any validation error. I have provided require validation for every field.

Thanks and Regards,
Soumya
GreyHead 19 Dec, 2012
Hi Soumya,

Sorry, I have no idea. It may be possible with some complex JavaScript. Please let us know if you succeed.

Bob
gfarr 11 Jun, 2013
Hi Soumya,

Did you find a solution for this issue? If yes can you please share it here?

Thanks
This topic is locked and no more replies can be posted.