multiple-value

<select> tag and returning multiple values to javascript method

人走茶凉 提交于 2021-02-19 04:29:05
问题 I have an issue with the data which is sent from a drop down menu, the selector only returns a single value, even when multiple values are selected. I have searched online for a solution to this, but they all use PHP, JQuery or some method outside the scope of the course I am taking; to capture multiple selected items. I have tried .value of the individual options, but that returns all of the options rather than just the ones which are selected. Is there some kind of trick to sending multiple

Cookie multiple values

若如初见. 提交于 2019-12-24 00:57:39
问题 In the php manual under section "cookies" it states that you can add multiple values to a single cookie by simply adding a '[]' to the cookie name. At first my understanding of this was to do the following: <?php setcookie("[user1]", "bill"); setcookie("[user2]", "tom"); print_r($_COOKIE); ?> and the out put was: 'Array ( )' Obviously after seeing an empty array I knew something was not right but, I had followed what the manual had stated. So I went in developer mode in the browser to see all

Android sqlite update row

二次信任 提交于 2019-12-09 19:02:41
问题 Im trying to update a row in my table but the update function seems not responding. Is everything ok with my function, or i'm I somewhere wrong? public int editChild(int id, String name, String dob, int gender, double weight, double lenght, int color, int status) { ContentValues args = new ContentValues(); args.put("name", name); args.put("dob", dob); args.put("weight", weight); args.put("lenght", lenght); args.put("color", color); args.put("status", status); return database.update(TABLE

Hashtable with multiple values for single key

江枫思渺然 提交于 2019-12-09 08:56:06
问题 I want to store multiple values in single key like: HashTable obj = new HashTable(); obj.Add("1", "test"); obj.Add("1", "Test1"); Right now this throws an error. 回答1: you can put your test,test1,test2,... in a table and then put this table in a Hashtable as a value for the key which will be the same for all them. For example try something like this: List<string> list = new List<string>(); list.Add("test"); list.Add("test1"); and then: HashTable obj = new HashTable(); obj.Add("1", list); 回答2:

Boost::property_tree: Using std::vector<> in XML parser to store multiple values in one key

一笑奈何 提交于 2019-12-08 03:31:02
问题 My question is related to this question: Boost property_tree: multiple values per key and to a question following that question: Boost property_tree: multiple values per key, on a template class. I am trying to parse an XML file in which multiple values are listed at a single key value using std::vector<> . The following code is what I have implemented so far: #include <boost/optional.hpp> #include <boost/property_tree/xml_parser.hpp> namespace boost { namespace property_tree { template

PHP Select List - Insert multiple values in database

谁说我不能喝 提交于 2019-12-07 13:26:38
问题 I'm trying to insert multiple values in the database using select list. What I got so far: HTML <form enctype="multipart/form-data" action="" method="post"> <select name="cars[]" multiple="multiple" style="width:300px"> <?php $getcars = mysql_query("SELECT cars_id, cars_name FROM car"); while ($row = mysql_fetch_assoc($getcars)) { $car_id = $row['cars_id']; $car_name = $row['cars_name']; ?> <option value="<?php echo $car_id ?>"><?php echo $car_name ?></option> <?php } ?> </select><br />

Passing multiple request parameters with same name from table rows

こ雲淡風輕ζ 提交于 2019-12-07 03:46:27
问题 I have a table with checkboxes that the user can check and delete that row in the table. I have everything working, but if the user checks two boxes, it only retrieves the first one on the table. <tr> <td><input type="checkbox" name="id" value="${user.id}" /></td> <td><c:out value="${user.name}" /></td> <td><c:out value="${user.email}" /></td> </tr> This is just an example of my HTML. Here is part of my servlet. String id = request.getParameter("id"); So, again, I can get the first value

How to assign multiple values at once to multi-dimensional array AFTER creating it - in C?

﹥>﹥吖頭↗ 提交于 2019-12-06 09:44:11
I'm programming in C and wonder if it's possible to assign multiple values at once to a multi-dimensional array? I have tried some technique but all have failed! I’m NOT interested to loop through the array to assign values (I want the fasted way to assign new values to all index in the array). The array I’m working with: ary[4][4]. Since an array is not a modifiable lvalue, it cannot appear on the left side of an assignment. You can initialize it and you can assign individual members via indexing. 6.3.2.1 A modifiable lvalue is an lvalue that does not have array type, does not have ... And a

Boost::property_tree: Using std::vector<> in XML parser to store multiple values in one key

狂风中的少年 提交于 2019-12-06 04:58:05
My question is related to this question: Boost property_tree: multiple values per key and to a question following that question: Boost property_tree: multiple values per key, on a template class . I am trying to parse an XML file in which multiple values are listed at a single key value using std::vector<> . The following code is what I have implemented so far: #include <boost/optional.hpp> #include <boost/property_tree/xml_parser.hpp> namespace boost { namespace property_tree { template<typename type> struct vector_xml_translator { boost::optional<std::vector<type> > get_value(const std:

Get Enum name from multiple values python

随声附和 提交于 2019-12-05 18:18:33
问题 I'm trying to get the name of a enum given one of its multiple values: class DType(Enum): float32 = ["f", 8] double64 = ["d", 9] when I try to get one value giving the name it works: print DType["float32"].value[1] # prints 8 print DType["float32"].value[0] # prints f but when I try to get the name out of a given value only errors will come: print DataType(8).name print DataType("f").name raise ValueError("%s is not a valid %s" % (value, cls. name )) ValueError: 8 is not a valid DataType