close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Validating Data Assist Insert Multiple Records

Thread began 6/01/2009 9:00 am by cal114936 | Last modified 2/23/2010 12:41 am by neilo | 3901 views | 7 replies |

cal114936Beta Tester

Validating Data Assist Insert Multiple Records

First I am beginning to wonder whether it is possible to validate an Insert Multiple Records. Is it? If it is what is the sequence.

1. I have first created the form.
2. Setup the validation
3. Set the show if validation fails.
4. Bound the form fields to the validated values
5. Applied the repeat selection behavior
6. Applied the Insert Multiple Records Behavior.

This inserts the data, but doesn't validate.

I then tried appending _<?php echo $RepeatSelectionCounter_1; ?> to the validated field name.

<input name="contactLastName_<?php echo $RepeatSelectionCounter_1; ?>" type="text" class="bodyCopy" id="contactLastName_<?php echo $RepeatSelectionCounter_1; ?>" value="<?php echo(ValidatedField("epsReferences","contactLastName_<?php echo $RepeatSelectionCounter_1; ?>")) ?>" size="20" maxlength="25">

I am getting an ! to the left of the insert multiple records behavior as well.

Any suggestions?

Jack

Attached Files
eps_References.zip
Sign in to reply to this post

I-CRE8Beta Tester

I asked WA Support about this very subject back in August 2008 and their answer was

  Validation Toolkit does not support form elements that include a dynamic from elements name, because the Validation tool kit will insert code that validate form elements using the form element name.  



I ended up using a JS solution as this was part of a multiple add to cart routine that I was working on which you can see in action here: image.php?name=is-it-a-sine&id=46

Sign in to reply to this post

Ray BorduinWebAssist

Dave is correct. This is not currently supported.

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

cal114936Beta Tester

Any idea when it may be supported? Why did they develop a Multiple Record Insert that can't be validated?

Sign in to reply to this post

Ray BorduinWebAssist

We develop our tools separately, so sometimes one might be more advanced than the next.

We depend on bindings for most of our interfaces to work. With repeated elements, bindings strategy doesn't work, so we would need a pretty major overhaul to get it to work properly.

The reality is that the code would work if you were comfortable writing the loops and adding the validations by hand. It is the DW user interfaces that aren't prepared to work with repeated form elements.

I could try to explain the intricacies that make it difficult to pull off, but it should suffice to say it is a lot easier than it sounds.

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

cal114936Beta Tester

So... which direction do I go now? Writing the validation loops and validations by hand? I have to get this done, but I am not a programmer. (The path led to a cliff again.) Could you give a few more clues?

Sign in to reply to this post

Miguel

Originally Said By: jwright114936
  So... which direction do I go now? Writing the validation loops and validations by hand? I have to get this done, but I am not a programmer. (The path led to a cliff again.) Could you give a few more clues?  




I ran into the same problem so i looked for a ajax validation to do this and since you dont have much programing skills i tried this one wich is very very easy to use, check the attachment file here, the only bad thing about this validation is that its client side and needs javascript enable to work.


Ok how to use:


Step 1


download the zip file validation1.5.4.1.zip or go to really-easy-field-validation and download the script it also explain there how to use, but ill explain here how i did it with webassist.


Ok


Step 2
Open the page that has the multiple insert form and in the head of the page look for this in code view and copy paste the scripts file before </head> tag



Should look like this:

<script src="scriptaculous/lib/prototype.js" type="text/javascript"></script>
<script src="scriptaculous/src/effects.js" type="text/javascript"></script>
<script type="text/javascript" src="fabtabulous.js"></script>
<script type="text/javascript" src="validation.js"></script>
<style>
input.disabled {
border: 1px solid #F2F2F2;
background-color: #F2F2F2;
}

input.required, textarea.required {
border: 1px solid #00A8E6;
}
input.validation-failed, textarea.validation-failed {
border: 1px solid #FF3300;
color : #FF3300;
}
input.validation-passed, textarea.validation-passed {
border: 1px solid #00CC00;
color : #000;
}

.validation-advice {
margin: 5px 0;
padding: 5px;
background-color: #FF3300;
color : #FFF;
font-weight: bold;
}

.custom-advice {
margin: 5px 0;
padding: 5px;
background-color: #C8AA00;
color : #FFF;
font-weight: bold;
}

fieldset {
padding: 1em;
margin-bottom: 0.5em;
}

label {
font-weight: bold;
}
.form-row {
clear: both;
padding: 0.5em;
}

.field-label {

}

.field-widget {

}
</style>
</head>




be sure where you placed the scripts files example of one
<script type="text/javascript" src="../folder/validation.js"></script>
the best thing you can do if you dont have much programing knowledge is to past all the scripts in the same folder where your multiple insert page is


Step 3


now after that go to each of the forms elements and add this at the end


Class="require" title="any text to require example please fill your name"


a better example would be like i did for this name field

<input type="text" name="Name_<?php echo $RepeatSelectionCounter_1; ?>" id="Name_<?php echo $RepeatSelectionCounter_1; ?>" value="" size="32" class="required" title="Your Name is required"/>




Step 4


now scroll down to the end of the form it should look like </form>


and add this script:


<script type="text/javascript">
var valid1 = new Validation('FORMNAME', {useTitles:true});
</script>




In that script i have FORMNAME just change it to the name your form has, to know how its named scroll up until you find the opening of the form tag something like:


<form action="your_insert_page.php" method="post" enctype="multipart/form-data" name="FORMNAME" id="FORMNAME">


Save your document and press F12 to test it out.


Hope this helps :D

Attached Files
validation1.5.4.1.zip
Sign in to reply to this post

neilo

Hi Sades,

Thank you for posting your solution!

neilo

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