I have some html forms, to validate them I use html5 required field, it works great but on some forms I have ckeditor and I need to validate the presence of content in it. I can do it via javascript, but I want my output to be the same as html5 required field pop-up. Is there a way to call this pop-up manually an set it on DOM element I want?
Asked
Active
Viewed 3,432 times
4
-
possible duplicate of [Set custom HTML5 required field validation message](http://stackoverflow.com/questions/13798313/set-custom-html5-required-field-validation-message) – Luceos Dec 23 '13 at 12:25
-
could you provide sample code of what you are trying to achieve? Which DOM type element are you talking about?! – A. Wolff Dec 23 '13 at 12:25
-
@A.Wolff it doesn't matter which DOM element, it can be span or div, I just try to find a way how to call the pop-up from js – maki Dec 23 '13 at 12:32
-
Simple answer is required attribute is for input only so i guess you cannot do what you are looking for without maybe weird hack – A. Wolff Dec 23 '13 at 12:37
-
@A.Wolff is no way to display a similar looking pop-up? – maki Dec 23 '13 at 12:48
-
this popup is native to browser, so each browser has its own design for it, so not really possible. I guess you could try to use a kind of input not visible to hack it but without seeing anything you are currently doing, it is impossible to help you more. Anyway, better would be to use an other logic as using your own way to handle required elements – A. Wolff Dec 23 '13 at 12:53