close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

bootstrap multiple select update records

Thread began 4/21/2017 1:49 pm by Kumel | Last modified 4/24/2017 2:59 pm by Ray Borduin | 288 views | 6 replies |

Kumel

bootstrap multiple select update records

I m using following js: https://silviomoreto.github.io/bootstrap-select/methods/

Following is my code:

<select class="selectpicker" name="pendingdocs" multiple>
<?php
do {
?>
<option value="<?php echo $row_PendingDocTypes['DocumentTypeID']?>"<?php if (!(strcmp($row_PendingDocTypes['DocumentTypeID'], $row_ApplicationDetails['AppDocPending']))) {echo "selected=\"selected\"";} ?>><?php echo $row_PendingDocTypes['DocumentTypeName']?></option>
<?php
} while ($row_PendingDocTypes = mysql_fetch_assoc($PendingDocTypes));
$rows = mysql_num_rows($PendingDocTypes);
if($rows > 0) {
mysql_data_seek($PendingDocTypes, 0);
$row_PendingDocTypes = mysql_fetch_assoc($PendingDocTypes);
}
?>



</select>




I added single update record behaviour for the same. So this is a multi select dropdown option.

When i select multiple options & click update only 1 gets updated & multiple ain't getting updated.

If i select multiple options as: one, two, three; i want it to store as one, two, three

file also attached.

Sign in to reply to this post

Ray BorduinWebAssist

To allow multiple selections in php you need to name your form element: name="pendingdocs[]" (with the brackets).

That will pass the selected values as an array.

How did you want them inserted? Comma-separated? That would be done by updating line 167 to:
$WA_fieldValuesStr = "Y" . $WA_AB_Split . "".((isset($_POST["pendingdocs"]))?implode(", ",$_POST["pendingdocs"]):"") ."";

Sign in to reply to this post

Kumel

So it does update the data.. But i can't view it back on dropdown again.

I mean existing values aint displaying in dropdowns

Sign in to reply to this post

Ray BorduinWebAssist

You would have to use different code to re-select the values on the update page. What does the select list code look like on the update page currently?

Sign in to reply to this post

Kumel

<?php
do {
?>
<option value="<?php echo $row_PendingDocTypes['DocumentTypeName']?>"<?php if (!(strcmp($row_PendingDocTypes['DocumentTypeName'], $row_ApplicationDetails['AppDocPending']))) {echo "selected=\"selected\"";} ?>><?php echo $row_PendingDocTypes['DocumentTypeName']?></option>
<?php
} while ($row_PendingDocTypes = mysql_fetch_assoc($PendingDocTypes));
$rows = mysql_num_rows($PendingDocTypes);
if($rows > 0) {
mysql_data_seek($PendingDocTypes, 0);
$row_PendingDocTypes = mysql_fetch_assoc($PendingDocTypes);
}
?>

Sign in to reply to this post

Ray BorduinWebAssist

You could try:

php:
<?php

do {
?>
<option value="<?php echo $row_PendingDocTypes['DocumentTypeName']?>"<?php if (strpos($row_ApplicationDetails['AppDocPending'], $row_PendingDocTypes['DocumentTypeName']) !== false) {echo "selected=\"selected\"";} ?>><?php echo $row_PendingDocTypes['DocumentTypeName']?></option>
<?php
} while ($row_PendingDocTypes mysql_fetch_assoc($PendingDocTypes));
$rows mysql_num_rows($PendingDocTypes);
if(
$rows 0) {
mysql_data_seek($PendingDocTypes0);
$row_PendingDocTypes mysql_fetch_assoc($PendingDocTypes);
}
?>
Sign in to reply to this post

Kumel

awesome.. thnks a lot

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