Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to get all selected Checkbox values into a sql query
    primarykey
    data
    text
    <p>I have a multiple filter query like this: <img src="https://i.stack.imgur.com/p59Q9.png" alt="pic"></p> <p>I want to make the checkboxes be selected and then added to the following query:</p> <pre><code>var db = Database.Open("RMS") ; var selectCommand = "SELECT * FROM RMS"; var formSSO = ""; var formCase_Status= ""; var fromDate = ""; var toDate = ""; var SQLSELECT = "SELECT * FROM Admins WHERE Email = @0"; var Email = WebSecurity.CurrentUserName; var data1 = db.QuerySingle(SQLSELECT, Email); var Name = data1.Name; formSSO = Request.QueryString["formSSO"]; formCase_Status = Request["formCase_Status[]"]; fromDate = Request.QueryString["fromDate"]; toDate = Request.QueryString["toDate"]; selectCommand = "SELECT * FROM RMS WHERE Assigned_To = @4"; if(!Request.QueryString["formSSO"].IsEmpty() ) { selectCommand +=" AND SSO LIKE @0"; } if(!Request.QueryString["formCase_Status"].IsEmpty() ) { selectCommand +=" AND Case_Status = @1"; } if(!Request.QueryString["fromDate"].IsEmpty() ) { selectCommand +=" AND Created &gt;= @2"; } if(!Request.QueryString["toDate"].IsEmpty() ) { selectCommand +=" AND Created &lt;= @3"; } </code></pre> <p>I can get it working if only one checkbox is selected but my main point is to allow multiple checkboxes to be checked. How can I do this either with JS or Jquery I have tried answers on other qts but they don't quite go with what I am doing. I don't want an alert but a way that I can call all checked values in the select statement.</p> <p>This is the checkbox:</p> <pre><code>&lt;li class="form-line form-line-column" id="id_20"&gt; &lt;label class="form-label-top" id="label_20" for="input_20"&gt; Status &lt;/label&gt; &lt;div id="cid_20" class="form-input-wide"&gt; &lt;input type="checkbox" checked="@(Request["formCase_Status[]"] == "In Progress")" name="formCase_Status[]" value="In Progress"&gt; In Progress&lt;br&gt; &lt;input type="checkbox" checked="@(Request["formCase_Status[]"] == "Pending")" name="formCase_Status[]" value="Pending"&gt; Pending&lt;br&gt; &lt;input type="checkbox" checked="@(Request["formCase_Status[]"] == "Closed")" name="formCase_Status[]" value="Closed"&gt; Closed&lt;br&gt; &lt;/div&gt; &lt;/li&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload