Grails: Create a select with "jumps" on a range - grails

What I want:
<select ...>
<option ...>0</option>
<option ...>5</option>
<option ...>10</option>
<option ...>15</option>
...
<option ...>1000</option>
</select>
I know that by using grails tag g:select I can specify -from="${0..1000}" - however I can't find any info on the docs on how can I specify "jumps" (not to show option 1,2,3,etc).

You can use
${(0..1000).step(5)}

Related

<option value="value1,value2"> in Thymleaf

I want to do something like
<option value="value1,value2">
in thymleaf. I know for one value all i have to do is
<option th:value="${value1}">
How to pass two values in select option in Thyemleaf.
Use the templating correctly:
<option th:value="${value1} +' '+ ${value2}">

How do I make product column width in Volusion span the entire screen for mobile and have products stack?

Trying to make product column width in Volusion span the entire screen for mobile and have products stack below. I am working out of this site: http://enpgp.fzsvf.servertrust.com/category-s/100.htm and you can see on mobile the products simple cram together as opposed to stacking.
You need to go to each category that you want to be responsive and select in the category display mode dropdown menu "Responsive Grid".
If that option for some reason is not shown you can force the category into "responsive mode" by changing one of the options in the "Product Display Mode" to "7" and then select it and click the save button. You would do that with Firebug. You could also import a "7" into "Product Display Mode" for that category via the API.
<select name="Category_DisplayMode" onblur="ProcessFieldUsage(this);" onkeyup="ShowSave()" onchange="ShowSave()">
<option value="">Select</option>
<option value="1">Single Rows</option>
<option value="2">Grid</option>
<option value="4">Checkboxes</option>
<option value="5">List</option>
<option value="6">Lightweight Grid</option>
</select>
Shown after the modification
<select name="Category_DisplayMode" onblur="ProcessFieldUsage(this);" onkeyup="ShowSave()" onchange="ShowSave()">
<option value="">Select</option>
<option value="1">Single Rows</option>
<option value="2">Grid</option>
<option value="4">Checkboxes</option>
<option value="5">List</option>
<option value="7">Lightweight Grid</option>
</select>

Mark prepopulated select options as selected in asp.net razor

I am trying to do select an option in a select element. I tried the following code. But it does not work.
<select>
<option value="1" #(ViewBag.dt.Rows[0][1].ToString())=="1"? selected>A</option>
<option value="2" #(ViewBag.dt.Rows[0][1].ToString())=="2"? selected>B</option>
<option value="3" #(ViewBag.dt.Rows[0][1].ToString())=="3"? selected>C</option>
</select>
Any help?
Thank you.
Your conditional operators appear incomplete (invalid code).
Did you mean:
<option value="1" #(ViewBag.dt.Rows[0][1].ToString() == "1" ? "selected" : "")>A</option>
I would normally suggest switching to #Html.RadioButtonFor but that will not handle a two-dimensional array references. Are you display multiple items in a loop? You may be able to simplify the whole thing (please show the rest of your page/code).

Ruby RoR, Ransack, multiple select query fails

using the ransack gem i've seen that it should be possible to use a form with multiple select.
using the basic html for the select form I use, and then select BOTH options to that I can attempt to search for either value
<select id="q_c_0_v_0_value" name="q[c][0][v][0][value][]" size="1" multiple="multiple">
<option value="SGD">SGD</option>
<option value="USD">USD</option>
</select>
and also tried
<select id="q_c_0_v_0_value" name="q[c][0][v][0][value]" size="1" multiple="multiple">
<option value="SGD">SGD</option>
<option value="USD">USD</option>
</select>
with combinations for all of the predicates "equal any", "contains any" etc,
I get resulting
SELECT "auctions".* FROM "my_table" WHERE (("auctions"."currency" LIKE '%["SGD", "USD"]%'))
and
SELECT "auctions".* FROM "my_table" WHERE ("auctions"."currency" LIKE '%USD')
Any ideas, the link https://github.com/ernie/ransack/issues/7 says its possible, but I dont seem to get the right results.

How to convert multi select form field with GET tto have propper URL?

<select name="channel[]" multiple="multiple">
<option value="pants">Pants</option>
<option value="tshirts">T-Shirts</option>
<option value="sweats">Sweats</option>
</select>
So, form is GET, and if I select multiple, and when I click on submit URL is like:
?channel[]=pants&channel[]=tshirts
I need it to be like:
?channel=pants+tshirts
This cannot be achieved with an HTML only form. You'll have to incorporate javascript to manipulate the value of channel.

Resources