Error message when validation failed

teoyh

Member
Hi community , I need some idea for the following issue ;

I have a form and in this form I had inserted 3 tables to show the data that is relating to the record being displayed.
Illustration as below
Table 1
Table 2
Table 3
form
element 1
element 2
element 3

If the user do not fill in form element 1, 2 or 3 he will not be able to submit the form and an error message will be shown.

Everything works fine but the only problem is when there is an error the submission will stop until the user corrected the error.

The problem the user face is he/she does not know there is an error until he scroll down to the bottom of the form.

Is it possible to auto scroll down whenever there is an error , or pop up an alert message ?

Thank you in advance
 
Are you using a custom form template?

If you do, please check with the default "bootstrap" form template, where 3 things should happen if (for example a "notempty") validation fails:
1. The page reloads but "jumps" to the top of the page,
2. at the top of the form you have the message that something went wrong,
3. the field(s) with errors are highlighted and showing an error message below.

However, if it's different in your case due to your template and your own preferences, you can use custom JS to make the page reloading with a specific page element at the top. If you google around, you should easily find code examples.
 
Are you using a custom form template?

If you do, please check with the default "bootstrap" form template, where 3 things should happen if (for example a "notempty") validation fails:
1. The page reloads but "jumps" to the top of the page,
2. at the top of the form you have the message that something went wrong,
3. the field(s) with errors are highlighted and showing an error message below.

However, if it's different in your case due to your template and your own preferences, you can use custom JS to make the page reloading with a specific page element at the top. If you google around, you should easily find code examples.
But from js how to determine that there is an error then I execute the window.scrollTo(300, 500) ?
 
There may be more elegant ways but, if nothing else, you could check for existence of the main error message.
 
Use for any template, go and get this system messages free plugin: https://www.minitek.gr/joomla/extensions/minitek-system-messages
Adjust color, size, location etc in plugin settings. You can stay message indefinitely to be closed by user or for a definite time to be faded automatically.

for use in php validation or form submit, customize your messages and use the code below for example:
Code:
JFactory::getApplication()->enqueueMessage('Project Manager successfully assigned for Monthly Tech Operations for this Project- '.$prjname.' of the organisation- '.$orgname.'', 'message');

To alter the message type like success, warning, info and error, replace 'message' with following code, what you want:

'message' for success(green);
'notice' for info(blue);
'warning'(yellow);
'error'(red);

Edit: Or you can just leave it to joomla/Fabrik to generate default messages without customising the messages as shown above.

Thanks,
Sunit
 
Last edited:
Use for any template, go and get this system messages free plugin: https://www.minitek.gr/joomla/extensions/minitek-system-messages
Adjust color, size, location etc in plugin settings. You can stay message indefinitely to be closed by user or for a definite time to be faded automatically.

for use in php validation or form submit, customize your messages and use the code below for example:
Code:
JFactory::getApplication()->enqueueMessage('Project Manager successfully assigned for Monthly Tech Operations for this Project- '.$prjname.' of the organisation- '.$orgname.'', 'message');

To alter the message type like success, warning, info and error, replace 'message' with following code, what you want:

'message' for success(green);
'notice' for info(blue);
'warning'(yellow);
'error'(red);

Edit: Or you can just leave it to joomla/Fabrik to generate default messages without customising the messages as shown above.

Thanks,
Sunit
Cool , I will check out this plugin , many thanks for responding :)
 
Found this and its working
var els = document.getElementsByClassName("ClassName");
var searchValue = "bear";
for(var i = 0; i < els.length; i++){
if(els.innerHTML.indexOf(searchValue) > -1)
{ //match has been made }
}
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top