close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Dynamic selectlist with repeating value based on table-column.

Thread began 3/23/2020 4:57 pm by Jonas | Last modified 3/24/2020 2:48 pm by Ray Borduin | 35 views | 4 replies |

Jonas

Dynamic selectlist with repeating value based on table-column.

In a form, I want the user to be able to choose the number of places. To make it easy from a UX perspective, I want a select list for this. Here, the number of places from one upwards displays. Maximum number of places should be dynamic, based on the column. How do I do this? I suspect I will create some kind of repetition.

Sign in to reply to this post

Ray BorduinWebAssist

I'd have to see the page and understand the database structure to give any advice on exactly how to do it. The Repeat Selection server behavior will allow you to repeat for a set number of rows, which you could then go into the code and update to come from a recordset.

I'd give it a try and post here if you get stuck and include the file you are working on for reference so I can see what you have done and get a better idea of what you want to do.

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

Jonas

This post has been deleted.

Jonas

I succeeded, but I had to hand-code everything. Unfortunately, I do not understand how I could use WA for this. Below is the code for the select list that now works as I wish:

<?php $startnr = 1; ?>
<!-- *** Antal *** -->
<div class="form-group">
<label for="Antal"><i class="fas fa-star-of-life"></i> Antal personer (max <?php echo($WADABokning_update->getColumnVal("PlatserKvar")); ?> st)</label>
<select name="Antal" required="required" class="form-control" id="Antal" onChange="KW_calcForm('Summa',1,0,'#Antal','*','#Prisklass')">
<option value="">Välj antal</option>
<?php while($startnr <= $WADABokning_update->getColumnVal("PlatserKvar")) { ?>
<option value="<?php echo "$startnr"; ?>"><?php echo "$startnr"; ?></option>
<?php
$startnr++;
}
?>
</select>

<div class="invalid-feedback">Vänligen fyll i antal platser</div>
</div>

Sign in to reply to this post

Ray BorduinWebAssist

I don't think there would be a way to do this without hand coding like you have. It just isn't a common enough scenario to have a UI built to account for it.

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

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