close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

jQuery validation

Thread began 12/08/2015 11:17 am by iain331081 | Last modified 12/11/2015 4:02 pm by Ray Borduin | 3283 views | 11 replies |

iain331081

jQuery validation

I have been looking at adding ckeditor to some forms to allow some text formatting, but this has broken the jQuery validation.

Am looking online for solutions, and there are quite a few kicking about, but they tend to be specific to particular flavours of the jQuery validation.

Is the one used in the WA extensions a particular one I should be looking out for?

Sorry, the clue is in the (file)name - h5validate.js?

Sign in to reply to this post

Ray BorduinWebAssist

Jquery validation should work fine with a ckeditor text field on the page. Do you have a sample URL where it isn't working properly? I can take a look and see what the issue is.

Sign in to reply to this post
Did this help? Tips are appreciated...

iain331081

Thanks Ray.

Sign in to reply to this post

Ray BorduinWebAssist

The jquery validation seems to be working on that page... what should I be looking at?

I do see another unrelated javascript error on the page... you should move the jquery includes:

<script src="../_/js/jquery.js"></script>
<script src="../_/js/foundation.min.js"></script>

to the top of the page since you have a script referencing jquery up there:

<script type='text/javascript'>
$(document).ready(function(){
$('.popbox').popbox();
});
</script>

Sign in to reply to this post
Did this help? Tips are appreciated...

iain331081

Its working on the fields without the text editor, but it would be good to also validate the Document Details field with the text editor. Or can you see that one working too?

Thanks for the spot on those script references - have moved them up to the header.

Sign in to reply to this post

Ray BorduinWebAssist

I've made an update to DataBridge so that you can do validation on html editor fields. Just reinstall the latest version and update the jquery validation script and htmleditor code.

You will still have to manually add the validation code to the html editor instance for now. In the code just before the line that reads:
$CKEditor->editor(

add lines like:

$CKEditor_config["props"] = array();
$CKEditor_config["props"]["required"] = true;
$CKEditor_config["props"]["min"] = 20;
$CKEditor_config["props"]["max"] = 1000;

min and max are optional and can be used to set the number of characters allowed.

The effected files that need to be updated are:
/webassist/ckeditor/ckeditor_php4.php
/webassist/ckeditor/ckeditor_php5.php
/webassist/jq_validation/jquery.h5validate.js

I've also attached them in a .zip so you can replace them without having to re-apply any of the code in Dreamweaver.

Attached Files
ckeditor_validation.zip
Sign in to reply to this post
Did this help? Tips are appreciated...

iain331081

Thanks Ray - although I think the issue might be confused as I downloaded CKeditor separate to any WA stuff.

So there is just the reference to:

<script src="../ckeditor/ckeditor.js"></script>

And this code after each text area:

<script>
CKEDITOR.replace( 'details' );
</script>

So I don't see the line:

$CKEditor->editor(

I did have a feeling CKeditor used to be built into some WA stuff, but couldn't see it, so found it on their site.

I did use this one years ago on another site, with CKeditor / WA, and dug out an old page.

Continued below...

Sign in to reply to this post

Ray BorduinWebAssist

In that case, just use the new jquery.h5validate.js and add the required attribute to the ckeditor textarea.

Sign in to reply to this post
Did this help? Tips are appreciated...

Ray BorduinWebAssist

Did you upload the webassist/ckeditor folder? That would be necessary to have it display properly.

Sign in to reply to this post
Did this help? Tips are appreciated...

iain331081

Thanks Ray - just looking at that.

The version currently uploaded (attached blow) references the new jquery.h5validate.js file.

And I have added <?php require_once("../webassist/ckeditor/ckeditor.php"); ?> to the top of the page and uploaded the webassist/ckeditor folder.

And have the required attribute on the text area that the CKeditor replaces - but not sure if something needs to go in this part:

<script>
CKEDITOR.replace( 'details' );
</script>

like you posted above, but I can't get it to work, e.g.:

<script>
$CKEditor_config["props"]["required"] = true;
CKEDITOR.replace( 'details' );
</script>

or

<script>
CKEditor_config["props"]["required"] = true;
CKEDITOR.replace( 'details' );
</script>

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...