close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Validations appear to fail as expected, but no messages appear either client or server

Thread began 2/07/2014 10:59 am by evansg7124312885 | Last modified 2/18/2014 10:17 am by Jason Byrnes | 1159 views | 15 replies |

evansg7124312885

Validations appear to fail as expected, but no messages appear either client or server

I have a feeling I am going to feel pretty dumb when this question gets answered, but here goes:

I started with a themed page and then added a form. No issues in the form tool, design went as expected. I can see and edited both the client and server validation error messages in the code, but not in design view (this is not normal). I added a validation to enforce unique value required to one form field, I then did some editing to the Captcha appearance and tested page. On testing, the required form fields do not show error messages when left empty and when the add record button is pressed, I see the server activity behavior, the page redirects to itself with the "invalid" URL value set to "true", but no messages appear at any stage of testing. I have not added any of the insert record or other planned behaviors on this page, pretty simple function, but I would like to know what I have missed in my validations before finishing page as I do use these functions quite a bit.

All extensions were brought to current this morning and even though nothing crashed, I reset the view and deleted cache files. I work on a Mac 10.8 with DW 5.5.

Thanks, and I look forward to hearing what I am missing

Sign in to reply to this post

Jason ByrnesWebAssist

this script:

<script src="../webassist/forms/wa_servervalidation.js" type="text/javascript"></script>
<script src="../webassist/jq_validation/jquery.h5validate.js"></script>
<script>
var Default_NewFromBlank_Default_Opts = {
focusout: true,
focusin: false,
change: false,
keyup: false,
popupClass: "Bloom",
pointedAt: "left",
fieldOffset: 10,
fieldMargin: 2,
position: "left",
direction: "left",
border: 1,
offset: 25,
closeText: "?",
percentWidth: 100,
orientation: "bottom",
};
function Default_NewFromBlank_Default_Validate() {
$("#Default_NewFromBlank_Default").h5Validate(Default_NewFromBlank_Default_Opts);
}
$(document).ready(function () {
Default_NewFromBlank_Default_Validate()
ConvertServerErrors(Default_NewFromBlank_Default_Opts);
});
</script>
<script src="../webassist/forms/wa_servervalidation.js" type="text/javascript"></script>
<script src="../webassist/forms/wa_servervalidation.js" type="text/javascript"></script>
<script>
var Default_NewFromBlank_Default_Opts = {
focusout: true,
focusin: false,
change: false,
keyup: false,
popupClass: "Bloom",
pointedAt: "left",
fieldOffset: 10,
fieldMargin: 2,
position: "left",
direction: "left",
border: 1,
offset: 25,
closeText: "?",
percentWidth: 100,
orientation: "bottom",
};
function Default_NewFromBlank_Default_Validate() {
$("#Default_NewFromBlank_Default").h5Validate(Default_NewFromBlank_Default_Opts);
}
$(document).ready(function () {
Default_NewFromBlank_Default_Validate()
ConvertServerErrors(Default_NewFromBlank_Default_Opts);
});
</script>


should be at the bottom of the page near the closing body tag.


also, doesn't need to be duplicated.

Sign in to reply to this post

evansg7124312885

That helped, but exposed a couple new problems

That was a quick reply, thanks.

I am getting my error messages now, but one little issue and possibly a bigger problem with my set up.

The Captcha validation error appears immediately on page load. Also, when form is submitted, the URL is still saying invalid="true" and the error is validation message is appearing at the Captcha text box.

When I set up the validation, I set server variable to the forms text box and the like entry to the session variable for the Captcha. Am I using the correct values?

Second minor issue: am I supposed to see the same type of error messages between the client and the server validations? I can not recall if in prior builds they both appeared in the pop up unless I used the Spry tool, I always thought they were text entries next to the validation error where you saw the "show if" behavior for the validation error. Speaking of Spry tool, where is that now or has it been replaced with the jQuery function?

Sign in to reply to this post

Jason ByrnesWebAssist

1) the code that generates the captcha sets the name of the captcha session using:
field=fieldset_group_Security_code_2

this genreates the session as:
captcha_fieldset_group_Security_code_2

in the server validation, you are using
captcha_fieldset_group_Security_code

change:
$WAFV_Errors .= WAValidateLE((strtolower(isset($_POST["fieldset_group_Security_code"])?$_POST["fieldset_group_Security_code"]:"")) . "",((isset($_SESSION["captcha_fieldset_group_Security_code"]))?strtolower($_SESSION["captcha_fieldset_group_Security_code"]):"") . "",true,3);

to:
$WAFV_Errors .= WAValidateLE((strtolower(isset($_POST["fieldset_group_Security_code"])?$_POST["fieldset_group_Security_code"]:"")) . "",((isset($_SESSION["captcha_fieldset_group_Security_code_2"]))?strtolower($_SESSION["captcha_fieldset_group_Security_code_2"]):"") . "",true,3);

2) validation failure is saved in a session.

once failure occures, you will see the validation errors untill:
a) ryou restart the browser

or:
b) Submit successfully

3) Yes, the validation errors for server and jquery are the same.

you can edit the server validation error messages by editing the code in the show if, and the jquery error by editing the
title attribute of the form tags.

4) yes, spry was replaced by jquery.

Sign in to reply to this post

evansg7124312885

That fixed it

Life is good again. Of course this generates a new question:

The changes in session variable names, we were up to _2. When I pulled up the bindings panel, this session variable is not in the list. I did edit the form contents a couple times and I also was working in the Captcha edit a time or 2. Does one or both of these edits change the session variable name? If so, any idea why I do not see the new session variable name in the bindings panel?

Not something I have to know, if it happens again I will (should) know where to look. Thanks again for the quick responses, it is hard to go on to the next project with pieces of a prior project nagging at you.

Sign in to reply to this post

Jason ByrnesWebAssist

adding a new captcha will change the session name.

sometimes dreamweaver gets bad about adding new bindings.

use the OS file system browser and browse to the site root files and delete the _notes folder. that should allow DW to create bindings again.

Sign in to reply to this post

evansg7124312885

New file, similar problem

Created a new file and added a form to it, when I tested, the same problem as above occurred with the validations. I tried pasting in the script, but this time the problem did not change and the form submit button would not work. Is there something within that script that I missed that is unique to the file or the contents?

When you said not necessary to repeat in your first response, I was not clear what that meant. I assumed within that file.

I removed the script from above, so the file that you are looking at is a page created by theme that a form was added to. No modifications beyond that.

Thanks for the assistance with this,

Sign in to reply to this post

Jason ByrnesWebAssist

this is the code that generates the captcha image:
<img src="../webassist/captcha/wavt_captchasecurityimages.php?field=fieldset_group_Security_code&amp;font=fonts/MOM_T___.TTF" alt="Security Code" class="Captcha" /> </div>
<div class="fullColumnGroup" style="clear:left;">


the img src is:
webassist/captcha/wavt_captchasecurityimages.php?field=fieldset_group_Security_code&amp;font=fonts/MOM_T___.TTF"

the first url variable field:
?field=fieldset_group_Security_code

is used to set the captcha session name as:
captcha_<field value>

captcha_fieldset_group_Security_code


so in this case, the captcha session will be named.

in the server validation, the code for the captcha validation is:
$WAFV_Errors .= WAValidateLE((strtolower(isset($_POST["fieldset_group_Security_code_2"])?$_POST["fieldset_group_Security_code_2"]:"")) . "",((isset($_SESSION["captcha_fieldset_group_Security_code_2"]))?strtolower($_SESSION["captcha_fieldset_group_Security_code_2"]):"") . "",true,2);

it is referancing the session as:
$_SESSION["captcha_fieldset_group_Security_code_2"]

in other words using a session named
captcha_fieldset_group_Security_code_2

but it should be using:
captcha_fieldset_group_Security_code

change that line to:
$WAFV_Errors .= WAValidateLE((strtolower(isset($_POST["fieldset_group_Security_code_2"])?$_POST["fieldset_group_Security_code_2"]:"")) . "",((isset($_SESSION["captcha_fieldset_group_Security_code"]))?strtolower($_SESSION["captcha_fieldset_group_Security_code"]):"") . "",true,2);


the form element:
<input id="fieldset_group_Security_code_2" name="fieldset_group_Security_code_2"


so:
$_POST["fieldset_group_Security_code_2"]
is correct, but the session being used is not.

Sign in to reply to this post

sysop349733

"yes, spry was replaced by jquery." -- Jason

This caught my eye as I was hoping this would happen eventually. Is it now Webassist's validation method? The forms I'm building are still dropping in Spry. I'm not sure how to tell what version of DataBridge I'm using to compare to the latest available.

Also, if jQuery validation is now WebAssist's default, what's involved in updating pages that use Spry? Is there a tutorial, perhaps?

Sign in to reply to this post

Jason ByrnesWebAssist

open the extension manager to see the installed version.

Data Bridge 1.1.8 and eCart 6 use jquery validation.


to convert a form that is already created, you would need to manually remove the spry code, then use the WebAssist -> Forms -> Jquery behavior to add the jquery validation.

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...