RocketCDS
Installation
Integration
RocketCDS
Installation
Integration
Installing AppThemes
Partial And Shared Templates
Razor Tokens
Dependancy
JQuery Validation
DNN Search
File Download
Rocket Tools
ChatGPT
DeepL
Simplisity JS
Command Attributes
Methods
Class Events
Field Data
Utility Functions
Ajax DropDownList
RocketContent
Create an AppTheme
Adding CSS and JS
Adding Resx
Multi-Row AppTheme
DataObjects
Razor Tokens
Shared Templates
Snippets
ArticleLimpet
ArticleRowLimpet
RocketDirectory
Create an AppTheme
DataObjects
Razor Tokens
Shared Templates
MenuManipulator
Category Menu
Text Search
Property Filter
Tag Filter
Secure Document
Snippets
RSS feed
Related Articles
ArticleLimpet
RocketForms
Create an AppTheme
DataObjects
Functionality
Module Settings
# JQuery Validation JQuery validation can be added and used as a normal website. *See Documentation:* [jQuery Validation Plugin | Form validation with jQuery](https://jqueryvalidation.org/) #### Getting Started The base html page (*usually admin.html*) or the razor header template needs to include the link to the JS script. Either use the CDN on the JQuery Validation page or add Rocket version (could be an old version) ```html ``` English is the default message language, if you have other languages you must also add the localization js. We need to test which langauge is being used so we can add the correct message js. Therefore we must add these files using razor, or hardcode is we know which langauges. ```html @if (DNNrocketUtils.GetCurrentLanguageCode() != "en") { } ``` This works if injected in the body. Usually with admin panels the SideMenu.cshtml appears on all admin pages and can be used for this. #### Form required A form element is required for the validation to work. On the admin panel this form can be added to wrap the simplisity_startpanel. ```html
``` On normal front office webpages, the form may need to be added. #### Input Fields The input fields MUST have a unique "name" attribute. Otherwise only the first input will be validated. ```html
``` #### Trigger Validation Becuase we are using simplisityJS we do not have a "submit form" event for the ajax. We therefore use the **s-before** and **s-stop** attributes of simplisity. ##### Button ```html
Create
``` Notice the s-before calls a function "validatepopupdetail". ```js function validatepopupdetail() { var form = $("#rocketecommerceadmin_form"); form.validate({ errorClass: "w3-text-red", highlight: function (element, errorClass) { $(element).removeClass(errorClass); } }); if (form.valid()) { $('#portaldetail').hide(); } else { $('.portalcreatebutton').attr('s-stop', 'stop'); } } ``` **Notice:** *$('.portalcreatebutton').attr('s-stop', 'stop');* This stops the ajax from triggering the command to the server.