close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Client-Side Validation simply does not work on php page

Thread began 6/30/2009 1:46 am by office377308 | Last modified 6/30/2009 10:59 am by Ray Borduin | 5611 views | 5 replies |

office377308

Client-Side Validation simply does not work on php page

I have a form with file field, text, 2 dropdowns, a set of radio buttons and a text area field.
I started with just validating the text field, nothing else, yet.
the form tag is:
<form action="file_upload_control.php" method="post" enctype="multipart/form-data" name="Auftragsdaten" id="Auftragsdaten" onSubmit="WAValidateNM(document.forms[0].anzahl,'- Invalid number format',1,100,0,'','','.,',document.forms[0].anzahl,1,true)">

But the effect of not inserting any number, is, it jumps to the next page. No validation, no error message, nothing.

I recently updated to VA Toolkit ver. 2.3.5

If I apply DW built-in Form validation behaviour, validation works as expected.

I purchased DataAssists Validation Toolkit in order to use more sophisticated validation. Now it turns out it does even less than DW built-in functionalities.
Any idea?
PS.: I also use an insert record form and DA's file upload, here's part of the code:
// WA_UploadResult1 Params Start
$WA_UploadResult1_Params = array();
// WA_UploadResult1_1 Start
$WA_UploadResult1_Params["WA_UploadResult1_1"] = array(
'UploadFolder' => "../dyn/",
'FileName' => "[FileName]",
'DefaultFileName' => "",
'ResizeType' => "0",
'ResizeWidth' => "0",
'ResizeHeight' => "0",
'ResizeFillColor' => "" );
// WA_UploadResult1_1 End
// WA_UploadResult1 Params End
?><?php
WA_DFP_SetupUploadStatusStruct("WA_UploadResult1");
if(isset($_POST["upload"])){
WA_DFP_UploadFiles("WA_UploadResult1", "dateiraufladen", "0", "", "false", $WA_UploadResult1_Params);
}
?>
<?php
// WA Application Builder Insert
if (isset($_POST["upload"])) // Trigger
{
$WA_connection = $myConnection;
$WA_table = "myTable";
$WA_sessionName = "bst_bsID";
$WA_redirectURL = "";
$WA_keepQueryString = true;
$WA_indexField = "bsID";
.....
?>

I am not sure if this has anything to do with client-side validation, but I thought it might be useful to mention.

Sign in to reply to this post

Ray BorduinWebAssist

Do you have a url where I can view the error?

Validation toolkit offers advantages over DW validation mostly with its Server Validation. Spry is in fact more full featured than our client validation which is why we have started using spry in place of validation toolkit for client validations in our solutions.

Client validations can be used in conjunction with the DW spry validations and server validations can be applied on top since client validation is really not secure at all since all anyone has to do is turn off javascript to get passed it. That is the functionality that Validation Toolkit offers that is superior to what DW supplies.

Our validation is also more flexible in a lot of ways and can be used in conjunction with spry to help reformat, do contitional validation, or more specific validations that spry may not support, but that is a more advanced concept than I want to go into here.

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

office377308

Ok, but ...

Well I looked up the document where DA describes the differences between server and client validation. I have not looked into spry validation yet, but thanks for the hint.
I need to check the selection of a menu / list form element and afaik this is not covered by server side validation.
So, what I did until this, I used an old (2002) but nice extension from Yaromat which is free and does an excellent job in client validation.
It checks if the list/menu has been selected by "any but the first entry" which is useful if your first entry is something static like "select please".
In the meantime I used DA Client validation on a very basic html form and it still did not work at all.
WAVT_Client_Sample.php

This is actually the sample file from WA and it can be sent without filling any field.

Any idea?

Sign in to reply to this post

Ray BorduinWebAssist

In the WA extension you would use:

<option value="">select please</option>

and then use required validation on the list. Since the value is blank for that selection it will not pass validation until something else is selected.

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

office377308

right

You are right.

But my problem was that I did not even come that far with DA's client VT.

Any idea, why the validation does not work at all in the example given above?

Sign in to reply to this post

Ray BorduinWebAssist

It seems it didn't copy one of the necessary functions to the header.

If you open and reapply one of the behaviors in the form onSubmit event it would probably correct the error, or you can add the function to the header manually:

function WAFV_GetValueFromInputType(formElement,inputType,trimWhite) {
var value="";
if (inputType == "select") {
if (formElement.selectedIndex != -1 && formElement.options[formElement.selectedIndex].value && formElement.options[formElement.selectedIndex].value != "") {
value = formElement.options[formElement.selectedIndex].value;
}
}
else if (inputType == "checkbox") {
if (formElement.length) {
for (var x=0; x<formElement.length ; x++) {
if (formElement[x].checked && formElement[x].value!="") {
value = formElement[x].value;
break;
}
}
}
else if (formElement.checked)
value = formElement.value;
}
else if (inputType == "radio") {
if (formElement.length) {
for (var x=0; x<formElement.length; x++) {
if (formElement[x].checked && formElement[x].value!="") {
value = formElement[x].value;
break;
}
}
}
else if (formElement.checked)
value = formElement.value;
}
else if (inputType == "radiogroup") {
for (var x=0; x<formElement.length; x++) {
if (formElement[x].checked && formElement[x].value!="") {
value = formElement[x].value;
break;
}
}
}
else if (inputType == "iRite") {
var theEditor = FCKeditorAPI.GetInstance(formElement.name) ;
value = theEditor.GetXHTML(true);
}
else {
var value = formElement.value;
value=value.replace(/<p>(\&\#160\;)*<\/p>/,"");
}
if (trimWhite) {
value = WAtrimIt(value);
}
return value;
}
Sign in to reply to this post
Did this help? Tips are appreciated...

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