close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

incorrect validations

Thread began 6/03/2010 8:54 pm by neo314 | Last modified 6/10/2010 4:14 pm by Eric Mittman | 2238 views | 8 replies |

neo314

incorrect validations

I think I encountered 2 bugs using the form builder.

First, I specified the action to a different page of /apps/contact/sendmessage.php and all the validated fields for the form value if returned by the server side validations came out as:

<?php echo((isset($_GET["invalid"])?ValidatedField("/apps/contact/sendmessage","Contact_us_group_Email"):"")); ?>



When it should have been:

<?php  echo((isset($_GET["invalid"])?ValidatedField("sendmessage","Contact_us_group_Email"):""));  ?>



The other bug is that the includes do not start the session it seems. All my pages do, but the sendmessage.php page did not as a bare bones page, so the form values on an error in the validation were not actually getting returned until I discovered that.

Sign in to reply to this post

Eric Mittman

For the reference to the identifier in the validated field are you getting an error with it by default before you update it? I did a test and found that I had some fields referenced like this. In my testing the validations still seemed to be working just as they should. I'm not sure that this is a bug if it is not causing problems the way it is. Please explain a little more about this part and why you have updated it and what the difference is for you.

As for the session starting do you have the WAVT_ValidatedForm_PHP.php included at the top of your page? The first couple of lines of this file check to see if the session is started and if not it will start the session. Here is the code from the top of that page:

php:
if (!session_id())  {

  session_start();
}
Sign in to reply to this post

neo314

As for the session values, it was probably fine. I went off my notes after getting it working since it was different from the previous interface. I did see the session was active by diagnostic output when I still did not see the form values returned after validation. I think the problem was simply the error in the ValidatedField call. I can say for sure that

ValidatedField("/apps/contact/sendmessage","Contact_us_group_Email")
Did not work, but

ValidatedField("sendmessage","Contact_us_group_Email")
Did.

I also noted that the target page of the action did not get bound to the originating form automatically which the extension probably should do as well. Not a big deal, just an observation.

If it helps, I think (I don't remember for sure) that the extension generated the target file. I don't think I created it first which may or may not be related.

Sign in to reply to this post

Eric Mittman

I would like to look into this more with you to see what the results are for your page. I can test for the name that is referenced in the validation but when it comes to the target page not being applied can you expand on this further. Ideally I would like to have a set of steps that I can take that yield the result you are experiencing. I think this would be the best approach for this issue so we can look into it.

Sign in to reply to this post

neo314

Ok, it took me a few tries to recreate. I thought it might be customizing the form, or the template I used. I honestly could not remember the steps. I can only say I think this is the problem, but it produced similar results.

I believe what I did is, in a site that is set to document relative links, I set the action to a site root link because of how the form would be used in the web site (/apps/contact/sendMessage.php). Also note that, at least in my test, the target page did not exist yet. The extension creates the target page in the correct location, but does not put the correct values in the redirect of the target page validation and does not put the correct value in the validatedField function of the form page.

Understanding the problem now, it can be worked around, but the extension could also detect the type of action entered by how the link begins (/, ../, or filename), especially since it creates the target file in the correct location. I forgot to look and see how the action in the form came out, but I think it was correct.

Sign in to reply to this post

neo314

As an update, I think it actually created 2 versions of the target file. one in the right place and one in the directory structure specified in the gui under the current directory.

Sign in to reply to this post

Eric Mittman

I have done some testing with this and it seems that there can be issues with the page referenced in the action if you do not use the folder icon to choose the page. Whenever I create a form like this the validation code is correctly added to the action page and the validation code on the form looks correct. I can then update the action of the form after the fact to use the root relative path to the page.

I'm curious if you ever have this problem when you use the folder icon to select the action page. Currently it seems that the issue is just not using this folder icon to select the page, if you can add anything to this or confirm if this is not the case please post back let us know.

Sign in to reply to this post

neo314

That was interesting. I did not see any problem using the folder icon, but the landing page has to exist to do that.

I tried creating one with the page not existing yet, but entering a relative link (../test.php) rather than a site root link. It appears to have generated most of the code correctly except the value of the fields.

The value of the fields came out as:

<?php echo((isset($_GET["invalid"])?ValidatedField("","Appointment_request_group_Best_day"):"")); ?>



which I believe should have been:


<?php  echo((isset($_GET["invalid"])?ValidatedField("test","Appointment_request_group_Best_day"):""));  ?>



but the error message conditions look correct as:

<?php
if (ValidatedField('test','test')) {
if ((strpos((",".ValidatedField("test","test").","), "," . "5" . ",") !== false || "5" == "")) {
if (!(false)) {
?>
Sign in to reply to this post

Eric Mittman

Thanks for confirming this, I will ensure that a bug is logged for this. It seems that creating the file first and using the folder icon is the way to go for now.

Sign in to reply to this post

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