FAQ Database Discussion Community


Get text value from one div to input

javascript,jquery,html,css,value
how can i get each value from my divs to my input? Here is my code - I've managed to get all the values but i cannot get individual values? my fiddle and code below - <input class=".ui-spinner"></input> $(".cn-wrapper li span").click(function () { var textValue = $('.cn-wrapper li span').text(); $('.ui-spinner').val(textValue);...

DataColumn: combine columns and values into a string

c#,linq,concatenation,value,datacolumn
I'd like to use LINQ to take a datarow, and parse out the datacolumn names with their values. So if I had a dataRow with the following columns and values: DataColumn column1 with value '1' DataColumn column2 with value 'ABC' I'd like to have a string returned as "column1 =...

Inputting integers in to an array Error?

java,arrays,input,value
The purpose of my code is to display the student number and their respective grade as follows: Student Grade 1 53 2 45 So on... I used a 5x2 array, in which the user can input the values for the grade... However I run in to a problem, when inputting...

Excel to sum value of duplicates while retaining its duplicate text

excel,duplicates,value
I need help on a loooong list of values that is possibly having duplicates with its quantity needed to sum however while retaining its duplicates. Hard to explain, example of scenario and goal I'd like to achieve. Please help. Current Situation material value a 10 b 10 a 10 c...

Java Assign a Value to an array cell

java,arrays,cell,value
I have the class Mappa and subclass MappaFermi with the array attribute Sector sector, each of the cells of the array is supposed to have a name, in the code of the class constructor i haven't had any problem naming them (all tests were successfull), however in the subclass constructor...

How to get array which have some particular key

php,arrays,key,value
my array is [newconfig_name] => 'abc', [name] => 'xyz', [newconfig_qty] => '200', [qty] => '100' i need data which have key same as newconfig how to convert array like [newconfig_name] => 'abc', [newconfig_qty] => '200', without any loop...

PL/SQL can't put value into index by table

table,indexing,plsql,insert,value
I can't put my value of v_emp into my emp_table. It is all going wrong at this line: emp_table(counter) := v_emp; The error that i get is: invalid use of type name of subtype name I can't see what the problem is.. CREATE OR REPLACE PROCEDURE laatste_emp IS v_emp employees%ROWTYPE;...

isset(array_keys()) - Can't use function return value in write context [duplicate]

php,variables,value
This question already has an answer here: PHP syntax for dereferencing function result 22 answers I am aware that there are other threads on this. I am aware that this error is triggered by using empty() on a function call but my code is this: $request = $_REQUEST; if...

Java: Assigning a variable its current value?

java,variables,optimization,value
If I have a string that is currently empty String s = ""; and reassign it s = ""; is it bad it I don't do it like this? if(!s.isEmpty()){ s = ""; } or will the compiler pick up on it and optimize for me?...

Write value of checkboxes into database table in mysql/php [closed]

php,mysql,checkbox,insert,value
I'm currently working on a subscription form where you can select 3 different message boards. My database table looks like this: subID - INT dest - varchar sub1 - tinyint sub2 - tinyint sub3 -tinyint When you check a checkbox it should write a 1 in the database and when...

Search Google Spreadsheet for same value and append in next column in GAS

google-apps-script,append,spreadsheet,value
I've got a Google Spreadsheet which looks like this: ID | winkelName | 26/05/2015 | 1 | Foo | | 2 | Bar | | 3 | Foo2 | | 4 | Bar2 | | I'm trying to read and write an array of objects with the following structure: history[i].storeName...

Find registry value types in VB.Net

vb.net,types,registry,value,dword
I am creating a very basic registry viewer in VB.Net. I need to find the type of registry key (String, DWORD, Binary .etc) but I dont know how to using VB.Net and I cannot find an answer anywhere. http://s22.postimg.org/98acwiz01/Capture.png Here is a picture of what I am trying to do....

Python None < 0 = True?

python-2.7,value,nonetype
I am trying to do this program that asks the user to input and you select the minimum and maximum of the numbers you put in the problem is it does find the maximum but the minimum shows up as None, any help on this? I just want to understand...

How can I find the value of a property in Javascript?

javascript,properties,value
How can I find the value of the same property in different objects in Javascript only using property? Example: var o={ y:'efgh', x:'abcd' }; var m={ x:'abcd' }; ...

R - Comparing values in a vector to a single value (Using the apply family)

r,vector,compare,value
I Have this database (shortened) > head(testDB,25) Civilite Age Enfants Region Recence Frequence_visite_site Mailing_Clic 1 Mlle 18 Non Nord 5 5 Oui 2 Mlle 18 Non Sud 3 5 Oui 3 Mlle 18 Non Nord 3 8 Non 4 Mlle 18 Non Nord 7 6 Non 5 Mlle 18 Non...

How to insert value to external iframe input

jquery,iframe,value
I have button and external iframe, and I need click to button to insert to this iframe input some value $("#button").click(function(){ $('iframe').find('input').val('value'); }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script> <button id='button'>test</button> <br> <iframe src="http://www.abc.sk/pridat.aspx" width='900' height='500'></iframe> EXAMPLE...

how to change inner values of attribute of html element using jquery

jquery,html,value
I have following HTML <div class="badgeSignUp" value="{'component':'LP-Popup', 'flowType':'f', 'category': 'SM-Flight-HP', 'campaignId' : '5'}"> I want to change value of "category" using jquery. How to do this in best way?...

How do I return a value from a second function in PHP?

php,function,return,value
I'm a green green newbie trying to write a simple program in PHP. I use an HTML form to ask a "diner" to select an entree, which sends the choice to a PHP program.The PHP program is supposed to echo the entree choice, suggest a drink to the diner, and...

JQuery UI slider setting multiple input values

jquery,jquery-ui,input,slider,value
I am trying to get multiple values to change while sliding the JQuery UI slider. Basically changing 3 different values based on the slider's number. In this case I'm using a range of $100,000 to $2,000,000. Then I want to calculate 3 different values depending on the position of the...

Get input number value with JS

javascript,html,numbers,value
I have some issues with calculating some stuff with JS and getting the right values out of the input fields(number). When I use this code it doesn't show anything. So what is wrong with my JS? Do I need to include a Jquery file? <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0...

R - Identify common elements in data frame columns

r,data.frame,unique,value
Let's say I have the following data.frame: df <- structure(list(cloudiness = structure(1:47, .Label = c("ACCESS1-0", "ACCESS1-3", "BNU-ESM", "CCSM4", "CESM1-BGC", "CESM1-CAM5", "CESM1-CAM5-1-FV2", "CESM1-FASTCHEM", "CESM1-WACCM", "CMCC-CESM", "CMCC-CM", "CMCC-CMS", "CNRM-CM5", "CNRM-CM5-2", "CSIRO-Mk3-6-0", "CanESM2", "FGOALS-g2", "FIO-ESM", "GFDL-CM3", "GFDL-ESM2G", "GFDL-ESM2M", "GISS-E2-H", "GISS-E2-H-CC", "GISS-E2-R", "GISS-E2-R-CC", "HadCM3", "HadGEM2-AO", "HadGEM2-CC", "HadGEM2-ES", "IPSL-CM5A-LR", "IPSL-CM5A-MR", "IPSL-CM5B-LR",...

get value from the dynamic create textbox

c#,dynamic,value
I am quite new in asp.net. I am wonder how can I get the value of the textbox that create dynamically from C#. this code is the way i create the textbox from page load event... for( int i =0; i<30; i++){ TextBox txt = new TextBox(); txt.Text = "ASDASDASD";...

How to check if a linked list is a palindrome or not in Java?

java,reference,linked-list,parameter-passing,value
I wrote a code to check if a singly linked list is a palindrome. And I made two steps: 1st. reverse the original linked list. 2nd. Check if the original and reversed linked list have the same element. public static Boolean isPalindrome(Node input){ Node reversed= reverse(input); while (input!=null){ if(input.item!=reversed.item) return...

SQL Value is being replaced by the next value in table

sql,tsql,stored-procedures,sql-server-2012,value
Im doing this check between my Test enviroment and my prod environment. Im using a table and sending that table by email to myself with the data missing from test or prod(Data that isnt matching). SET @tableHTML NVARCHAR(MAX); SET @tableHTML = N'<H3> Rows </H3>'+ N'<table border = "1">'+ N'<tr><th>ID</th>'+ N'<th>Company</th>'+...

how to have default value for a text field only for new form in rails? iam using :value => “0”.but in edit form also iam getting '0' value

ruby-on-rails,forms,default,textfield,value
How to have default value for a text field only for new form in rails? I am using :value => "0" in form partial. But the problem is though I have a value in database, I am getting 0 in edit form. actually in new form for a text field...

How to get a value of a CheckBox from td (table), JavaScript?

javascript,jquery,html,checkbox,value
I have a table with text data but in one cell I have a checkbox. I can extract data from td, but I can't figure out how to extract the checkbox value Here's what I've tried (see attached picture!) $('#tableData tbody tr:eq('+row+')').find('td:eq(8)').eq(0).value https://drive.google.com/file/d/0BxKM9sqBGY28cXp5ZzVCc0dRc28/view?usp=sharing...

Select minimum value in columns after comparing each column to an input in sqlite

sqlite,input,compare,multiple-columns,value
I have the following table: Qual | C1 | C2 | C3 | C4 | 50 | 0.2 | 0.5 | 0.9 | 1.2 | 100 | 0.3 | 0.7 | 1.1 | 1.7 | I have an inputX1 (for example 50) and another inputX2 (= 0.7) and I am...

extracting particular fields of each record from input file into key/value pairs in apache spark

apache,key,field,apache-spark,value
The following is the input file to Apache spark processing. each record contains four fields as shown. User ID Movie ID Rating Date 6 9217 2 2005-04-28 00:00:00.000 6 9254 4 2005-04-20 00:00:00.000 6 9330 4 2004-11-17 00:00:00.000 6 9330 5 2004-09-27 00:00:00.000 6 1615 4 2004-09-15 00:00:00.000 6 1659...

JavaScript Copy Array By Value

javascript,arrays,json,copy,value
I have created an array and received another from a php file. The data is fine but when i try to copy one array to another, it seems like when i change arr1 then arr2 is also changed. It is being copied "by reference" and not "by value" as i...

Give value to Database by Pressing button

php,database,button,value
So i ran into some trouble not to long ago. As a student i am relativly new to programming and thus i often visit sites like these for help. My question is how can i add value to database by pressing a button. For me the problem here is that...

Value change Alert VBA

excel,vba,alert,value
so I'm trying do to a alert where if the column is changed to "496", it gives a MsgBox with a alert, and the the alert needs to say the row where the change as taken place and that the value was altered to "496", I'm also aiming at putting...

Python List To Dictionary - Without Value Overwrite

python,dictionary,key,append,value
Keys = [1,2,3] Values = [["a",1],["b",2],["c",3],["d",1]] Dictionary = dict.fromkeys(Keys) for d in Dictionary: for value in Values: if value[1] == d: # Add to dictionary Dictionary.update({d:value}) # else # Do Nothing print(Dictionary) When I run this piece of code, it works fine until I look closer at the its output....

Access - Using a Form Button To Set Field Value

ms-access,button,field,value
I'd like to create a 'colour wheel' in Access, where the user is shown a range of colours in a form and selecting any colour places the colour name in a table field. I thought of doing this through creating many buttons, each one a different colour. So when the...

Merge JSON Object with same “key” and add their “value” using JavaScript

javascript,json,merge,key,value
My JSON looks like this {"rows":[ {"key":["zeit.de"],"value":98}, {"key":["google.com"],"value":49}, {"key":["spiegel.de"],"value":20}, {"key":["spiegel.de"],"value":12}, {"key":["spiegel.de"],"value":20}, {"key":["spiegel.de"],"value":12}, {"key":["netmng.com"],"value":49}, {"key":["zeit.de"],"value":300} ]} and I am looking for a solution to merge all the same keys and add the values of the merged keys together to get something looking like this. {"rows":[ {"key":["zeit.de"],"value":398}, {"key":["google.com"],"value":49},...

.val() returning value ATTRIBUTE not content of

jquery,html,select,value
I'm currently adding my own jquery code to a site built and hosted by a third party (so I can't edit the HTML to remove attributes, etc). I'm trying to return the value of the currently selected item of a drop down box (for example this one goes from 100...

vb.net Get value from webbrowser to textbox

vb.net,textbox,value,getattribute
I'm trying to write a code to download a movie from some website and I'm stuck with trying to get this value to textbox, however rest of this code is already done so I think, that there will be no other problems. So this's code from a website:` <div style="width:750px;z-index:...

new dictionary from existing dictionary values

python,dictionary,key,append,value
I am trying to figure out how to perform the following: firstDictionary = {"firstKey" : "A", "secondKey" : "B"} secondDictionary = {"firstKey" : 3, "secondKey" : 47} emptyDictionary = {} for key, value in firstDictionary, secondDictionary: # emptyDictionary = some sort of append method... so that secondDictionary = {"A" :...

JQuery - change DIV html with Select Menu value

jquery,html,ajax,function,value
I have a JQuery SelectMenu with the values set as php include statements. I want those values to be ascribed to my div. I've looked at different resources and can't figure out the syntax. Here's the code that I wrote <script> $(function() { var display = $( "#display" ); $(...

Range value not shown in locals window in Excel VBA

vba,range,value
I was wondering why there is no value property for range object listed in locals window. The value2 is listed there. At the same time I use the Range.Value in the code and it works ok: Set Rng = Range("D6:D9") Set Rng2 = Range("B2:B5") Rng2.Value = Rng.Value Does it mean...

How do I get an xml node text?

c#,xml,text,value
I have an xml file with nodes containing codes that I need to get into a string, if the suffix selected matches the one in the xml. This is how my xml looks like: <ntcode NTCODE="BTM"> "2","724,02F,FFFFFFFF,FFFFFFFF,FF","724,03F,FFFFFFFF,FFFFFFFF,FF" </ntcode> <ntcode NTCODE="CLR"> "1","724,05F,FFFFFFFF,FFFFFFFF,FF" </ntcode> And this is the code I'm using: XmlDocument...

Microstrategy documents - matching differen attributes with the same value

attributes,document,matching,value,microstrategy
I'm building a document with a dashboard-like appearance. I'm using radio buttons for selecting the year. Sadly in one of my datasets the attribute year is another attribute, even if contains exactly the same values. How can I solve the problem of matching attributes basing on their values in documents?...

Pass value to the previous webpage in php

php,cookies,value
I want to know how I can pass value by cookie from one page to the pervious one , This is my code Readcookie.php <?php foreach($_COOKIE as $key => $value) {echo("<p>$key: $value</p>"); $name=($_COOKIE['name']); } print('<a href="coockie.php?name:"'.$name'>Go to Home</a>'); ?> Cookie.php <!DOCTYPE html> <html> <?php $name=$_GET['name']; echo'Hello'.$name; ?> <form method="post" action="setcookie.php">...

How to fix One Function has been called 2 times have 2 value?

java,function,buffer,value
I've an array including four digits. A function calculates them and returns the value by one var Total. Then, I call another function which deletes one digit from the array and calls the calculate function afterwards. The final value I got was Total + Total (After it deletes one digit)....

How do i get values from the dropdown menu?

arrays,multidimensional-array,drop-down-menu,value
I have made a simpel dropdown menu where i can select navn but I dont know how to get the sukker_g values from later parts of the array. What I want is to get the sukker_g value so I can use thise numbers later in the prodject var person =...

Angularjs reload value in factory

global,value
I am a newbie in AngularJS and I get some difficulties. I've got an Angular value that should be available globally in some factories. It stores an adressess of other services and by default all values are null: angular.module('env_settings') .value('address', { management: null, data_store: null, repository: null, single_service: null });...

Android global variable dynamic value

android,global-variables,value
Hello all i want to make use of a global integer variable that i shall be incrementing in 7 different activities according to the users right or wrong choise. The problem is that i every time i implement the variable in each different activity , the value is not kept....

R - get values from multiple variables in the environment

r,environment-variables,value
I have some variables in my current R environment: ls() [1] "clt.list" "commands.list" "dirs.list" "eq" "hurs.list" "mlist" "prec.list" "temp.list" "vars" [10] "vars.list" "wind.list" where each one of the variables "clt.list", "hurs.list", "prec.list", "temp.list" and "wind.list" is a (huge) list of strings. For example: clt.list[1:20] [1] "clt_Amon_ACCESS1-0_historical_r1i1p1_185001-200512.nc" "clt_Amon_ACCESS1-3_historical_r1i1p1_185001-200512.nc" [3] "clt_Amon_bcc-csm1-1_historical_r1i1p1_185001-201212.nc"...

Ways to assign value to variable [duplicate]

javascript,function,variables,value
This question already has an answer here: “Variable” variables in Javascript? 8 answers I have a form written in html with a fields for first name, last name etc. Now I am creating a function that checks if what was inputed in those fields meets the requirements (like amount...

how to change a obj value in the uploader (ajax)?

javascript,ajax,object,value,uploader
i still try to change just 1 value on thish Script via js (remotePath), please give me informations :) Thank you! $('#uploader_div').ajaxupload( { url: 'upload.php', dropArea: '#drop_here', remotePath: 'user/user1/', <-- how to change only this value ... like this remotePath: 'user/user2/' Update: <div id="uploader_div"></div> <a id="link" href="#" onclick="newvalue();"> Change user2...

How define textarea content on form edit (Symfony2/TWIG)

forms,symfony2,textarea,twig,value
I want to display a specific content in my editForm textarea so I try like text field but it doesn't work : {{ form_widget(edit_form.description, { 'attr': {'value': 'content'} }) }} {{ form_errors(edit_form.description) }} How can I do it in TWIG ?...

fetch json value with no key using jquery

javascript,jquery,json,key,value
i am having trouble fetch JSON using jQuery, if possible someone tell me what mistake i made because my code is not working data.json file contain { "value1", "value2", "value3", "value4" } and here is my jquery code $.getJSON( "data.json", function( data ) { $.each( data, function( val ) {...

Unwrapping Json Swift (found nil)

json,string,swift,nsdictionary,value
i currently trying to decode Json in Xcode, but i not succed to get one of them. This is what i get : [ { "id": "1", "title": "bmw", "price": "500.00", "description": "330", "addedDate": "2015-05-18 00:00:00", "user_id": "1", "user_name": "CANOVAS", "user_zipCode": "32767", "category_id": "1", "category_label": "VEHICULES", "subcategory_id": "2", "subcategory_label": "Motos",...

Spring boot: Read a file PATH from “application.properties”

java,xml,spring,properties,value
I'm using Spring Boot and I want to read a file path from the resources/application.properties file and set its value to a String in a Java class: resources/application.properties mypath=dir/file.ext resources/application-context.xml <context:property-placeholder location="classpath:application.properties" /> MyJavaClass.java @Component public class MyJavaClass{ @Value("${mypath}") String mypath; public void printme(){ System.err.println(mypath); } } When I try...

PHP : How to set array Value with $_GET

php,url,get,value
i tried to set the value of the $_GET[] into an array object this is my code $X=array( 'status_1'=>'"'.$_GET['hasil_1'].'"', 'status_2'=>'"'.$_GET['hasil_2'].'"', 'status_3'=>'"'.$_GET['hasil_3'].'"', . . 'status_17'=>'"'.$_GET['hasil_17'].'"'); //Faktor Klasifikasi $n = 'derajat'; //nama tabel $table='tabel'; classify($X,$n,$table); it's not working . this is the url...

set values from jquery array of objects php?

php,jquery,arrays,set,value
I am getting particular list of product items through ajax, by passing their unique id to server. Now each product has its own set of properties which I have to display on page with product image. When I set the values through jquery, only last value in the array got...

Fetch data-value of specific elements

javascript,jquery,arrays,value
When creating a scheduler type system that allows the user to choose months, days, hours and minutes they wish for task to run, I have created DIVs that represent each option. I used "data-value" to store the actual integer value that is the representation. When they submit the form, I...

Add spaces and/or breaks in concatenated text from variables of values input fields in jQuery

jquery,variables,input,concatenation,value
Trying to get some spaces and/or breaks in the textarea that has its content added dynamically depending on the amount and type of input based o values. All works as it should except the textarea where all the values are added together as a string without having any breaks or...

c# loop and get the values of all datetimepicker in form programmatically

c#,winforms,loops,datetimepicker,value
I have a form with multiple TextBox and NumericUpDown And DateTimePicker. I want to get programmatically all value of this controls and insert them to sql server data base I tried this code foreach (Control contrl in this.Controls) { if (contrl.Name != "") { vv.Add(contrl.Text); //MessageBox.Show(contrl.Name); } } it gets...

Modify a value in a foreach to change another one

javascript,php,foreach,textbox,value
I've got a question about this foreach loop: foreach ($result as $row) { $html.='<tr> <td>'.$row['product_name'].'</td> <td>'.recupHourMinSec($row['date_add']).'</td> <td><input type="text" name="preparationTime" id="preparationTime" value="15" /></td> <td>'.date('H:i:s', strtotime("+$preparationTime mins".$row['date_add'])).'</td> <td>'.$row['lastname'].' '.$row['firstname'].'</td> <td>'.$row['phone'].'</td>...

Shifting id values of existing rows in mysql

mysql,phpmyadmin,auto-increment,alter-table,value
I have a table in a mysql database, in which every row has an id column with auto increment. The id values start at 1, and end at 639. What I need to do is change the id column of each row, so that the count doesn't begin at 1...

Global variables have nil value, attempt to call global (a nil value) in Corona

lua,corona,global,nil,value
I attempt to get data (in a global variable) from user through a textbox from the user in functions, and use these variables to insert into a sqlite table. But, when I attempt to do so, I get an error like "attempt to call global locationGlobal (a nil value)" in...

jquery accordion get height value

jquery,height,jquery-accordion,value
I'd like to get the height value of the individual panels when active. I know I can use $(document).height() or $(window).height(), but I want to actual height value of the active panel. Is this possible? <ul id="allTabs"> <li><a id="tab-1" href="#buildTab" onclick='windowResize("mainAccordion");' >Build</a></li> <li><a id="tab-5" href="#setupTab" onclick='windowResize("setupAccordion");'>Setup</a></li> </ul> function windowResize(what){ var...

How to get modified text from input JQuery or javascript

javascript,jquery,text,input,value
I'm having a problem getting modified text from input. The input is loaded with some text I get from a database and with an option i should take the onlyread attr off and change the values. Thats ok but when i click on the save button after writing something else...

ASP.NET mvc Ajax Helper DropDownListFor send selected item value as parameter to controller

asp.net-mvc-4,asp.net-ajax,value,dropdownlistfor,ajaxhelper
Problem I want my Ajax form to pass the value of the selected DropDownListFor to the controller but I can't figure out why the controller is not taking any value. I am working with ASP.NET MVC and I would like to stick with the helper functions as much as I...

Polymer bounded property not updating (sometimes)

javascript,binding,polymer,value
This problem is with 1.0 I have the following html in a polymer element <iron-selector attr-for-selected="step-number" selected="{{stepNumber}}"> <section step-number="1"> <page-1 id="page1"></page-1> </section> <section step-number="2"> <page-2 id="page2"></page-2> </section> <section step-number="3"> <page-3 id="page3"></page-3> </section>` page 1 fires an event - event1, page-2 fires event2. Here's my javascript for the polymer element function...

Printing an int value obtained from user

c,printing,int,scanf,value
The problem is at the age part, the compiler does not give me any errors but when I run it it prints a random number for int age printf("Enter your name:"); scanf(" %s",&name1); int age; printf("\n\nHow old are you?"); scanf(" %d",&age); char gender; printf("\n\nEnter your gender[Male/Female]:"); scanf(" %s",&gender); char confirmation;...

Checking if the value exists in database

php,sql,database,pdo,value
Fatal error: Call to a member function execute() on a non-object in C:\xampp\htdocs\registration2.php in this code: <form method="post" action=""> <label>Email</label><input type="text" name="email"/><br> <label>Heslo</label><input type="password" name="password"/><br> <label>Heslo znovu</label><input type="password" name="passwordagain"/><br> <label>Nickname</label><input type="text" name="nickname"/><br> <input...

DDD: Can an entity have attributes of primitive data types?

object,attributes,entity,domain-driven-design,value
The domain driven design differentiates two model types: entities and value objects. In the most examples the attributes of an entity are value objects or other entities, while the attributes of a value object are mostly simple strings, integers etc. (i. e. primitive data types). That leads me to the...

clone one interface in another of the same type in c++

c++,pointers,interface,clone,value
I want to make a copy of one object of one specific type of interface with another of the same interface, here i will write 2 class examples and their output. This is class Vehicle: #ifndef _VEHICLE_ #define _VEHICLE_ class Vehicle { public: Vehicle(int a): val(a) {} virtual ~Vehicle() {}...

Setting array key value pair JavaScript

javascript,arrays,key,value,pair
So, I am having an issue and for the life of me I cannot seem to resolve it. It seems very basic, but I just cannot understand for the life of me why this code is not working. My issue is, I am assigning a key value pair to an...

Passing a js variable value in an input type hidden and then retrieve it with php

javascript,php,input,hidden,value
I would like to count number of submitted form by user with javascript and then put the number of submitted form in a value attribute of an input type hidden and then retrieve that value with PHP (with the name attribute of the input hidden) Here is a simple code...

Finding the price element in DOM [closed]

html,value,steam,marketplace,calculated
So i am searching inside Steam's webside, and i am looking for the price value, but i can't find. The only thing that i found is the "Starting price" title (Kezdő ár means Starting Price in my language). And the other field is blank, where should i search for the...

Saving the click counts of an item each item it is clicked

javascript,php,count,save,value
Currently I try to build up a like counter for my web page. Below you can see the click counter. It's fully working. Sadly (but for sure) just for the current session... Is there any possibility to store the value forever? One last thing! On the website is more than...

How to display every key and value in a dictionary apart from one in python [duplicate]

python,dictionary,key,value
This question already has an answer here: Iterating over dictionaries using for loops in Python 6 answers dict1 = {"Bear":3,"Wine":3,"Spirits":7,"No":0} Here I have a dictionary and I want to display every key and value from Bear, Wine and spirits so it would look something like this: Bear 3 Wine...

How to store slider values in a vector

arrays,matlab,vector,slider,value
I'm using Matlab to create a GUI. Herefore I'm using the guide function of matlab. I want to store the slider values in a vector. I am doing this in the callback function: for i = 1:10 X(i) = get(handles.slider1,'Value'); end But this results in a vector that stores the...

iterate through object and filter given a specific value in a given property javascript

javascript,loops,object,properties,value
I have looked online and have been unable to find a detailed answer on the question I am having. I have an object which looks something like this: { "00001": { "sid": "00001", "oid": "00001", "name": "operation 0001 service 1", "description": "test operation 000001", "returntype": "something", "parameters": { "00001": {...

Angular data binding object in value attribute of option in select

angularjs,select,ng-repeat,value
I have a select item which I'm populating using ng-repeat in option. I use angular's data binding to set the value of the selected item to my model. But for some reason the " in the json string are now turned into \" . Because of this I can't reach...

Minimum character count text box

javascript,html,textinput,value
my code isn't working for some reason..here it is: html: <input type="text" name="post" maxlength="140" /> and for javascript: var inpt = document.getElementsByName("post")[0]; // var inputValue=document.getElementById(post).value; if (inpt.value < 10) { return false; alert("Post must be longer than 10 characters."); } else { return true; } i tried it with and...

Getting value of toggled select fields in jquery

jquery,onchange,value
Im trying to get the value of a selection based upon a previous on change selection. This is the initial html that shows or hides the next select: <div class="selectOptionCat"> <select class="categoryName1 changeFields" name="option"> <option value="1">One</option> <option value="2">Two</option> <option value="3">Three</option> </select> </div> Depending on the above selection another selection hides...

Problems returning a value while using a trait and companion object in Scala (Eclipse IDE)

scala,main,value,trait,companion-object
I've placed the following code into an object.Scala file within Eclipse, and simply want to know what the value for "x" is (it should be 3). The code won't compile if I place the value anywhere other than within the List object; at the same time, while within the List...

javascript class accessibility variable scope issue

javascript,class,object,scope,value
I'm writing a short class (first time using class in Javascript) for handling a menu icon for my site. this menu icon need to be able to be instancied multiple time on the same page. I have an issue when using scroll event fired function that seems to not be...

Android maintain variable values in Service when app is swiped away

android,variables,service,sticky,value
My app uses a sticky service to do things in background even when the app is closed. When the app is swiped away, the service doesn't stop(or gets restarted). But all the variable values gets reset to the initial value. I wan't to keep all the variable values even when...

Android - Void methods cannot return a value

android,methods,tablelayout,void,value
I have an activity with a tablelayout. I put text into the layout from string arrays. But now I get the error: "Void methods cannot return a value" public class stop10 extends SherlockFragmentActivity { String[] column1; String[] column2; View view; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.stop10); TableLayout prices...

Problems with transition on flex: 0, but still working on flex: .0001?

css,transition,flexbox,value
While working on a little project, I stumbled into having to transition from flex: 1to flex: 0. It took me a while to understand that it was only for this that the result was broken. After testing a bit I've found out that flex is transitionable, but not if one...

Mysqli not returning the rows

php,mysqli,value
Here is the code that i have so far. I am trying to return the name and email. But i can' able to get the value from the database, Here is the code i have tried so far to get the details from the database Here is the code :...

JS Combine array values into one single value

javascript,arrays,object,value
I have this object a = {key:'animals', options: ['dog','cat','penguin']} How can I simplify it to this: b = ['animals','dogcatpenguin'] ...

How to split the value of an text-field into an array containing every single char, and than accessing this array?

javascript,arrays,string,loops,value
I would like to split the value of a text field in each character and replace each value of the array thereby incurred by the equivalent in another array. The value in the text field can always be of different lengths. But how can I do that? Do I have...

Get column value on count (MySQL/Java)

java,mysql,count,value
I'm trying to get the number of times where a username has been found in a table, the thing is that I am just getting a value of "1" every time, even if the username is not found (where the value should be 0) I think the problem is that...

Iterate through Id's, store values, put into an array

javascript,jquery,arrays,value,iterated-function
I want to be able to iterate through a number of ids called "#option1", "#option2" etc. The problem is its for an interactive form and I don't know how many options there will be. So I need a way to iterate through the amount in the DOM when the user...

display parameter value within formula crystal reports

parameters,crystal-reports,report,formula,value
I'm using Crystal Reports 14. I have a formula which based on two parameters (from month, to month) display different text AND different parameters My code is as follows IF ({parameter1}) = 1 AND ({parameter 2})=14 THEN 'text {?parameter3} text' My problem is that instead of the value of paramter3,...

Drag & drop database images

php,jquery,image,drag-and-drop,value
I have a drag & drop system in my website and in need for help. The website is about schemes and managing them. You know, inserting scheme using a drag & drop system and showing them from the database afterwards. Everything works fine actually, but for the website they...

How can i find closest value given map? [closed]

c++,dictionary,find,value
I have a map like: typedef map<double, double> Test; Test test; I want to find a nearest value of given data, for example: Given the value 5.12, what is the closest value in the map? How can I do that?...

Swap key and value in a map in fsharp

dictionary,f#,key,swap,value
How to create a new map that is similar to the original one, but with swapped keys and values in Fsharp? For example, I have this let map1 = [("A", "1"); ("B", "2"); ("C", "3");] |> Map.ofList and want to get this: let map2 = [("1", "A"); ("2", "B"); ("3",...

PHP get ranges of same values from array

php,arrays,key,range,value
Is there any way to get the key range of same values and make a new array? Let's say we have an Array Like this in php : $first_array = ['1'=>'a','2'=>'a','3'=>'a','4'=>'b','5'=>'b','6'=>'a','7'=>'a']; How can i get this array? Is there any function for this? $second_array = ['1-3'=>'a','4-5'=>'b','6-7'=>'a']; ...

Need to Add two varibles under same value in array

php,arrays,session,add,value
I have a cart system that uses array_push to add cart items to cart. The problem is that it doesn't add price of the item to array. How can I get it to add: Item - ItemPrice Item_2 - ItemPrice_2 Item_3 - ItemPrice_3 as a set. Not as a separate...

Insert a value in a Mysql database using Python

python,mysql,input,insert,value
I am trying to insert values typed from me to a MySQL database. I am using python 3.4 and mysql.connector. Here is the part of the script: Value = int(input("Type a number between 1 and 10: ")) cursor.execute("""INSERT INTO test VALUES ('Number', Value )""") I am actually trying to find...

How to limit for loop to print first few element from list in terms of their value in python?

python,list,loops,element,value
I would like to limit for loop to print first few element from list in terms of their value. For example, if i < 6 : list = [1,2,3,4,5,6,7,8,9,10] for i < 6 in list: print(i) Thanks in advance !...

Converting key,value object to key,value array in Javascript

javascript,arrays,object,key,value
Please refer to fiddle js file object obj1. (I'm starting out with an object this format because it represents what I get back from Ajax when PHP echos back an ordered key,value PHP array). var obj1 = { "key1": "val1", "key2": "val2", "key3": "val3" }; box1.innerText = "Object: " +...

Update and delete, with value typed, in MySQL using Python

python,mysql,delete,mysql-python,value
I am trying to update and delete a row of a field, which row has a name same as the value typed, from a MySQL database. I am using python 2.7 and MySQLdb. Here is the part of the script: Value = int(input("Type a number between 1 and 10: "))...

Excel VBA - Value & MsgBox

excel,vba,alert,value
I posted a question about this piece of code that is already changed by "Alex Bell", He helped me with the code making a MsgBox appear every time the value "496" appears in that specific range. But due to my poor knowledge in this language, there's a lot of things...