Tooba Atif
Posts: 0
Joined: Fri Apr 04, 2014 3:07 am

How to show top of screen on Validation Failed?

I have a contact form that has some mandatory fields and I have use JS validation to check the mandatory fields. Now if the validation failed the error should appears in red on the top of the screen but currently on submit the screen is not scrolled to the top and shows the same position of screen.
How can I show the top of the screen on validation failed?

My js is something like this
if(code === '')
{
Appery("lblRequiredFields").text('Please enter numeric data.');
return;
}

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

How to show top of screen on Validation Failed?

Hi Tooba.

You should execute code to get app scroll top.

So please try to modificate your code with code below:

precode

if(code === '')
{
Appery("lblRequiredFields").text('Please enter numeric data.');
jQuery("body")[0].scrollTop = 0;
return;
};

/code/pre

Regards.

Tooba Atif
Posts: 0
Joined: Fri Apr 04, 2014 3:07 am

How to show top of screen on Validation Failed?

Worked perfect!
Thanks a lot :)

Can you help me with this please?
https://getsatisfaction.com/apperyio/...

I am still unable to load complete screen on page load. It has to wait for the option selected 1st then according to response from service it shows the next grid on the screen.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

How to show top of screen on Validation Failed?

Hello Tooba!

Please add an update to this post https://getsatisfaction.com/apperyio/... and let's continue there.

Return to “Issues”