close ad
WARNING PC USERS: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Multiple Update Form not working

Thread began 9/28/2009 12:20 pm by jon245706 | Last modified 11/03/2009 7:30 pm by Eric Mittman | 1455 views | 7 replies |

jon245706

Multiple Update Form not working

Hi

I'm using DataAssist 2.0.5. and have created a multiple update form following all the instructions in the help file and the online tutorial.

However, nothing appears, except:

No records match your request.
No records match your request.
No records match your request.
No records match your request.
No records match your request.

The correct number of lines are showing as I have 5 records to display, but I can't work out why the WA code is not displaying the fields properly.

Also, is there any reason why there are two While loops inserted by WA ?

--------------------------------------------------------------------------

The code is:

<%
While ((Repeat1__numRows <> 0) AND (NOT WADAMannequins.EOF))
%>
<tr align="left" valign="top">
<%
' RepeatSelectionCounter_1 Begin Loop
RepeatSelectionCounter_1_IterationsRemaining = RepeatSelectionCounter_1_Iterations
While(RepeatSelectionCounter_1_IterationsRemaining)
RepeatSelectionCounter_1_IterationsRemaining = RepeatSelectionCounter_1_IterationsRemaining-1
If(RepeatSelectionCounterBasedLooping_1 OR (Not WADAMannequins.EOF AND ((WADAMannequins_first+Repeat1__index) <= WADAMannequins_last)) ) Then
%>
<td class="WADADataTableCell"><input type="text" name="COLLECTION_<%=RepeatSelectionCounter_1%>" class="text_box_thin_white" id="COLLECTION_<%=RepeatSelectionCounter_1%>" value="<%=Replace((WADAMannequins.Fields.Item("COLLECTION").Value)&"", """", "&quot;")%>" size="32"></td>
<td class="WADADataTableCell"><input type="hidden" name="WADA_RepeatID_ID_<%=RepeatSelectionCounter_1%>" id="WADA_RepeatID_ID_<%=RepeatSelectionCounter_1%>" value="<%=(WADAMannequins.Fields.Item("ID").Value)%>" />
<input name="CODE_<%=RepeatSelectionCounter_1%>" type="text" class="text_box_thin_white" id="CODE_<%=RepeatSelectionCounter_1%>" value="<%=Replace((WADAMannequins.Fields.Item("CODE").Value)&"", """", "&quot;")%>" size="12" maxlength="32" /></td>
<td class="WADADataTableCell"><input name="NAME_<%=RepeatSelectionCounter_1%>" type="text" class="text_box_thin_white" id="NAME_<%=RepeatSelectionCounter_1%>" value="<%=Replace((WADAMannequins.Fields.Item("NAME").Value)&"", """", "&quot;")%>" size="32" /></td>
<td class="WADADataTableCell"><input name="PRIMARY_CODE_<%=RepeatSelectionCounter_1%>" type="text" class="text_box_thin_white" id="PRIMARY_CODE_<%=RepeatSelectionCounter_1%>" value="<%=Replace((WADAMannequins.Fields.Item("PRIMARY_CODE").Value)&"", """", "&quot;")%>" size="32" /></td>
<td class="WADADataTableCell"><textarea name="ADDITIONAL_INFO_<%=RepeatSelectionCounter_1%>" cols="32" rows="2" class="text_box_thin_white" id="ADDITIONAL_INFO_<%=RepeatSelectionCounter_1%>"><%=Replace((WADAMannequins.Fields.Item("ADDITIONAL_INFO").Value)&"", """", "&quot;")%></textarea></td>
<td class="WADADataTableCell"><input name="SIZES_<%=RepeatSelectionCounter_1%>" type="text" class="text_box_thin_white" id="SIZES_<%=RepeatSelectionCounter_1%>" value="<%=Replace((WADAMannequins.Fields.Item("SIZES").Value)&"", """", "&quot;")%>" size="32" /></td>
<td class="WADADataTableCell"><input <%If (CStr((WADAMannequins.Fields.Item("stylised").Value)) = CStr("True")) Then Response.Write("checked=""checked""") : Response.Write("")%> type="checkbox" name="stylised_<%=RepeatSelectionCounter_1%>" id="stylised_<%=RepeatSelectionCounter_1%>" value="1" /></td>
<td class="WADADataTableCell"><input <%If (CStr((WADAMannequins.Fields.Item("realistic").Value)) = CStr("True")) Then Response.Write("checked=""checked""") : Response.Write("")%> type="checkbox" name="realistic_<%=RepeatSelectionCounter_1%>" id="realistic_<%=RepeatSelectionCounter_1%>" value="1" /></td>
<td class="WADADataTableCell"><input <%If (CStr((WADAMannequins.Fields.Item("male").Value)) = CStr("True")) Then Response.Write("checked=""checked""") : Response.Write("")%> type="checkbox" name="male_<%=RepeatSelectionCounter_1%>" id="male_<%=RepeatSelectionCounter_1%>" value="1" /></td>
<td class="WADADataTableCell"><input <%If (CStr((WADAMannequins.Fields.Item("female").Value)) = CStr("True")) Then Response.Write("checked=""checked""") : Response.Write("")%> type="checkbox" name="female_<%=RepeatSelectionCounter_1%>" id="female_<%=RepeatSelectionCounter_1%>" value="1" /></td>
<td class="WADADataTableCell"><input <%If (CStr((WADAMannequins.Fields.Item("child").Value)) = CStr("True")) Then Response.Write("checked=""checked""") : Response.Write("")%> type="checkbox" name="child_<%=RepeatSelectionCounter_1%>" id="child_<%=RepeatSelectionCounter_1%>" value="1" /></td>
<td class="WADADataTableCell"><input <%If (CStr((WADAMannequins.Fields.Item("child").Value)) = CStr("True")) Then Response.Write("checked=""checked""") : Response.Write("")%> type="checkbox" name="ACCESSORIES_<%=RepeatSelectionCounter_1%>" id="ACCESSORIES_<%=RepeatSelectionCounter_1%>" value="1" /></td>
<td class="WADADataTableCell"><input <%If (CStr((WADAMannequins.Fields.Item("RECLINING").Value)) = CStr("True")) Then Response.Write("checked=""checked""") : Response.Write("")%> type="checkbox" name="RECLINING_<%=RepeatSelectionCounter_1%>" id="RECLINING_<%=RepeatSelectionCounter_1%>" value="1" /></td>
<td class="WADADataTableCell"><input <%If (CStr((WADAMannequins.Fields.Item("SEATED").Value)) = CStr("True")) Then Response.Write("checked=""checked""") : Response.Write("")%> type="checkbox" name="SEATED_<%=RepeatSelectionCounter_1%>" id="SEATED_<%=RepeatSelectionCounter_1%>" value="1" /></td>
<td class="WADADataTableCell"><input <%If (CStr((WADAMannequins.Fields.Item("SUSPENDED").Value)) = CStr("True")) Then Response.Write("checked=""checked""") : Response.Write("")%> type="checkbox" name="SUSPENDED_<%=RepeatSelectionCounter_1%>" id="SUSPENDED_<%=RepeatSelectionCounter_1%>" value="1" /></td>
<td class="WADADataTableCell"><input <%If (CStr((WADAMannequins.Fields.Item("NO_HEAD").Value)) = CStr("True")) Then Response.Write("checked=""checked""") : Response.Write("")%> type="checkbox" name="NO_HEAD_<%=RepeatSelectionCounter_1%>" id="NO_HEAD_<%=RepeatSelectionCounter_1%>" value="1" /></td>
<td class="WADADataTableCell"><input <%If (CStr((WADAMannequins.Fields.Item("LEANING").Value)) = CStr("True")) Then Response.Write("checked=""checked""") : Response.Write("")%> type="checkbox" name="LEANING_<%=RepeatSelectionCounter_1%>" id="LEANING_<%=RepeatSelectionCounter_1%>" value="1" /></td>
<td class="WADADataTableCell"><input <%If (CStr((WADAMannequins.Fields.Item("HIRE").Value)) = CStr("True")) Then Response.Write("checked=""checked""") : Response.Write("")%> type="checkbox" name="HIRE_<%=RepeatSelectionCounter_1%>" id="HIRE_<%=RepeatSelectionCounter_1%>" value="1" /></td>
<%
' RepeatSelectionCounter_1 Begin Alternate Content
Else
%>
<td>No records match your request.</td>
<%
' RepeatSelectionCounter_1 End Alternate Content
End If
If(Not RepeatSelectionCounterBasedLooping_1 AND RepeatSelectionCounter_1_IterationsRemaining <> 0 ) Then
If(Not WADAMannequins.EOF AND ((WADAMannequins_first+Repeat1__index) < WADAMannequins_last OR CInt(RepeatSelectionCounter_1_Iterations) = -1) ) Then WADAMannequins.MoveNext
If(WADAMannequins.EOF AND CInt(RepeatSelectionCounter_1_Iterations) = -1) THEN RepeatSelectionCounter_1_IterationsRemaining = 0
If(true) Then Repeat1__index = Repeat1__index+1
End If
RepeatSelectionCounter_1 = RepeatSelectionCounter_1+1
Wend ' RepeatSelectionCounter_1 End Loop
%>
</tr>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
WADAMannequins.MoveNext()
Wend
%>

Sign in to reply to this post

Eric Mittman

I know you mentioned that you followed the tutorials but I think it would help for you to review the steps you have taken to get the multiple update in place. The 'no records' error you are getting indicates that whatever reference you are using for the records is either not valid or not being set correctly.

As for the two loops this could be caused by having both a repeat region and repeat selection server behavior applied. Please post back with some more details about the steps you are taking and when you are getting this error.

Sign in to reply to this post

jon245706

More info

hi eric

thanks for info.

The page was generated by DataAssist, so it is a form for updating a single record from a table (as indicated in the help documentation).

I then selected the row with the input boxes in and select Multiple Record Update, at which point I get an error saying that I must select a Repeated Region.

So I set the TR to be a DW Repeated Region, then I try the Multiple Record Update again, at which point it does all the work, but inserts a second Repeated Region inside the first one.

I have now worked out that I should use the DA Repeat Region instead of the DW Repeat Region. This has solved the problem of the records not displaying.

However, the UPDATE performed now gets all the form fields wrong.

The values of the text input fields for the first record are used for every UPDATE command. And all the checkboxes are set to Checked, even though i select most of them to UnChecked.

??

Sign in to reply to this post

Eric Mittman

If you are getting the rite number of records updated then it seems that it is mostly implemented correctly. In your multiple update server behavior when specifying the field that the column gets its value from did you choose the repeated value? After the repeat selection is applied to the form element you should be able to choose it as repeated element from within the wizard.

If you can please post back with a copy of the page in it's current status zipped up and attached to your reply. I can examine the page to see if I can spot a reason for the problem you are experiencing.

Sign in to reply to this post

tn228553

List/Menu multiple values on Update page not inserting

I have a update page that has a column called ad_categories. This is a List/Menu form element that allows multiple selections. When I click on Update it only saves one of the values instead of both?

Here is a sample of the application with a sample record:

map_Advertisers_Results1.php

Thanks in advance.

Sign in to reply to this post

Eric Mittman

There are a few ways that you can deal with this multiple values for a single record. You could have another table that holds these values and has a column to relate to the main table with this info. This is probably the best way to go so that you can keep all of the data intact and easily retrievable.

You can also modify your existing page to allow for more than one value to be inserted into the column of your db based on the multi select from the form. This way though will leave you with a column full of value for a particular record and may not be the easiest way to retrieve results.

If you would like to have it work the way it is now you would need to do two things:

First, you will need to find the select input on the page and add [] to the end of it's name and id. This will force the php code to look at the data as an array of data, which it is.

If you just changed this you would seen an entry in your db that just said array. To break out the individual pieces you will need to add in an implode function around the value for this select list. When you add in the implode you will need to decide what character you would like to use as the separator.

In the code on the page this will look like this for your update:

php:
implode(", ", $_POST["your select list"])



This will make the array of user selections into one string with the values separated by a comma and space (, ). This implode function would be added to the source code inside of your update or insert server behavior. If you post back with the page in question in a zip archive I can show you where these changes would need to be made.

Sign in to reply to this post

tn228553

Tried []

Not luck, this is the edit I made to the form where name and id is. What did I do wrong?

<select name="ad_categories[]" id="ad_categories[]" size="15" multiple>
<?php
do {
?>
<option value="<?php echo $row_Cats['pid']?>"><?php echo $row_Cats['category']?></option>
<?php
} while ($row_Cats = mysql_fetch_assoc($Cats));
$rows = mysql_num_rows($Cats);
if($rows > 0) {
mysql_data_seek($Cats, 0);
$row_Cats = mysql_fetch_assoc($Cats);
}
?>
</select>

Sign in to reply to this post

Eric Mittman

The way you have added the brackets to the name of the element looks correct to me. What is the result you are now getting in your db when you have it like this?

Were you able to get the implode function in place properly?

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