close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

How to persist a field's value on form

Thread began 9/25/2012 1:21 pm by b_e_scott434630 | Last modified 10/03/2012 2:04 pm by b_e_scott434630 | 3860 views | 13 replies |

b_e_scott434630

How to persist a field's value on form

Hi,

When an invalid input field is entered on a validated form, the form is clearing the input values on all of the other fields. I only want the invalid field to be cleared. Is this part of a configuration option that I missed when setting up the form. If so, how can I turn that on. Second, if it's not a configuration option, do I need to add the functionality outside of Form Builder. If so, how is that done.

Thanks
Bruce

Sign in to reply to this post

Jason ByrnesWebAssist

on the bindings panel, there is a binding collection titled Validated Entries.

for each form element, bind the initial value to the corresponding validated entries binding.

Sign in to reply to this post

gavind

Hi. Does this guide also apply on the previous versions?

Sign in to reply to this post

Jason ByrnesWebAssist

Yes, this applies to previous version of server validation.

Sign in to reply to this post

b_e_scott434630

Thanks for the support.

Sign in to reply to this post

b_e_scott434630

I was able to get contact-us.php to work, but I'm unable to get buy-now.php to work. The fields clear out.

Code from contact-us.php

<div class="fieldGroup"> <span id="Full_Name_Spry"> <span>
<input name="Full_Name" type="text" class="formTextfield_Large" id="Full_Name" tabindex="1" onblur="hideServerError('Full_Name_ServerError');" value="<?php echo((isset($_POST["Full_Name"]))?$_POST["Full_Name"]:"") ?>" aria-controls="<?php echo((isset($_POST["Full_Name"]))?$_POST["Full_Name"]:"") ?>"/>
<span class="textfieldRequiredMsg">Please enter your name</span> </span> </span>




<script type="text/javascript">
<!--
var Full_Name_Spry = new Spry.Widget.ValidationTextField("Full_Name_Spry", "none",{validateOn:["blur"]});
var Email_Address_Spry = new Spry.Widget.ValidationTextField("Email_Address_Spry", "email",{validateOn:["blur"]});
var subject_Spry = new Spry.Widget.ValidationTextField("subject_Spry", "none",{validateOn:["blur"]});
var Comments_Spry = new Spry.Widget.ValidationTextarea("Comments_Spry", { minChars:10, maxChars:1000 , validateOn:["blur"]});
var Security_Code_Spry = new Spry.Widget.ValidationTextField("Security_Code_Spry", "none",{validateOn:["blur"]});
var Security_Answer_Spry = new Spry.Widget.ValidationTextField("Security_Answer_Spry", "none",{validateOn:["blur"]});
//-->
</script


Code from buy-now.php

1)
<div class="fieldGroup"> <span id="Fname_Spry"> <span>
<input name="Fname" type="text" class="formTextfield_Medium" id="Fname" tabindex="1" onblur="hideServerError('Fname_ServerError');" value="<?php echo((isset($_POST["Fname"]))?$_POST["Fname"]:"") ?>"/>
<span class="textfieldRequiredMsg">Please enter your first name</span> </span> </span>

2)
<script type="text/javascript">
<!--
var Fname_Spry = new Spry.Widget.ValidationTextField("Fname_Spry", "none",{validateOn:["blur"]});
var Lname_Spry = new Spry.Widget.ValidationTextField("Lname_Spry", "none",{validateOn:["blur"]});
var Address_1_Spry = new Spry.Widget.ValidationTextField("Address_1_Spry", "none",{validateOn:["blur"]});
var City_Spry = new Spry.Widget.ValidationTextField("City_Spry", "none",{validateOn:["blur"]});
var State_Spry = new Spry.Widget.ValidationSelect("State_Spry",{validateOn:["change"]});
var ZipCode_Spry = new Spry.Widget.ValidationTextField("ZipCode_Spry", "none", { minChars:5, maxChars:11 , validateOn:["blur"]});
var Phone_Number_Spry = new Spry.Widget.ValidationTextField("Phone_Number_Spry", "phone_number", { format:'phone_us' , validateOn:["blur"]});
var Email_Address_Spry = new Spry.Widget.ValidationTextField("Email_Address_Spry", "email",{validateOn:["blur"]});
var Co-App_Email_Address_Spry = new Spry.Widget.ValidationTextField("Co-App_Email_Address_Spry", "email", { isRequired:false , validateOn:["blur"]});
var Co_App_Phone_Spry = new Spry.Widget.ValidationTextField("Co_App_Phone_Spry", "phone_number", { format:'phone_us', isRequired:false , validateOn:["blur"]});
//-->
</script>

Here is what I did:
1) In dreamweaver, I open the web page in design view
2) I then clicked on the bindings icon
3) I selected the specific form source from the list of sources
4) I dragged each binding field source to the corresponding form field in the web page

I'm not sure what's the issue. Can you please help.

Thanks
Bruce

Sign in to reply to this post

Jason ByrnesWebAssist

your using the form collection bindings, you need to use the Validated Entries collection bindings instead.

Sign in to reply to this post

b_e_scott434630

Ok, thanks! Where do I find that. I don't see that when I click on the binding tab. I only see session , my form (which I was using), server variables

Thanks
Bruce

Sign in to reply to this post

Jason ByrnesWebAssist

are you not using server validation?

you would only see the validated entries collection if you where using server validation.

perhaps i don't understand what you are trying to do.

can you give more details please.

Sign in to reply to this post

b_e_scott434630

Hi,

I thought I had server side validation. Please see the attachment screenshot.

I'm trying to prevent the other fields from clearing out when a validation event is fired and field's value needs to be reentered or entered into a field.

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