jelly error
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2024 04:18 PM
hi i kept getting this error :The content of elements must consist of well-formed character data or markup. around these code :
if (form_warranty_end_date.value === '') {
alert('Warranty end date is required');
return false;
}
var warrantyDate = new Date(form_warranty_end_date.value);
var currentDate = new Date();
if (warrantyDate < currentDate) {
alert('The warranty has expired.');
return false;
}
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2024 09:43 PM
The error is because of the less than sign "<". Jelly is XML and the less than chevron is a reserved character.
If you're in a UI page you should be able to do the code in the client script portion instead in the XML.
If you're in a UI Macro then you'll need to use something like ${LT} or ${AMP}lt;
ie
...
if(warrantyDate ${LT} currentDate) {
...
//or
...
if(warrantyDate ${AMP}lt; currentDate) {
...