value

setting default values for empty nodes

Hello all I need to transform a piece of XML, so that the value of every node in a list I specify is set to "0" for example: <contract> <customerName>foo</customerName> <contractID /> <customerID>912</customerID> <countryCode/> <cityCode>7823</cityCode> </contract> would be transformed into <contract> <customerName>foo</custo...

jQuery when div is clicked update input field issue

Hello, I'm rather new to jquery so this may be the issue. I have a script that outputs several divs all with different text data in them. I would like it when I click one of them that an input field's value is updated to that text currently I have: <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/...

Difference between numeric and string value in PHP

Hi everyone, I am getting a difference when comparing two string which are 0 and '0' in PHP. Can I do anything to make them be compared equally in an if action? Thanks! ...

sql swap primary key values

Hi, is it possible to swap primary key values between two datasets? If so, how would one do that? ...

SelectedValue on html drop down list in MVC

I am new to MVC, so sorry if I am being a bit thick. I am using VB I am trying to fill an html drop down list using data from a db, but the first item is always selected, no matter what. What am I doing wrong? Here is my code - In the controller: ViewData("MatchTypeList") = New SelectList(_db.GetMatchTypes.ToList(), "MatchTypeID", "...

HTML Input on change of value

Hello, I have an input tag. This tag does not have the autocomplete feature turned off, thus, one does not necessarily need to release a key to change the value of this field and focus anotehr one. My question is: how can I detect ANY value changes of this particular field, like e. g. <input onvaluechange="//do following..." /> The ...

Java Properties and References -- I'm not getting what I expect.

I'm a little embarrassed to ask this as I ought to know better, but here's what I've got. I have an object "Pitcher" with an int property of "runsAllowed". I have an object Batter that has a property of "responsiblePitcher". I have an object Team that has a property "pitcher". When the batter reaches base: Batter.responsiblePitcher = ...

[Linq-To-Sql]How to return two values of different datatypes?

Here is my repository method which returns UserId , public IQueryable<int> getLoginStatus(string emailId, string password) { return (from r in taxidb.Registrations where (r.EmailId == emailId && r.Password == password) select r.UserId); } How to return UserName which is a string along with UserId... Any sugge...

How can I get a value out of a jQuery object?

I am returning some data (example below) and saving it to a jQuery object (or is this an array and I am confusing the two?) when I log the variable that is the object it has the values I am looking for but how do I access the data inside this object? code $itemPosition = { 'top': $item.offset().top, 'left':$item.offset().left }...

Returning new object, overwrite the existing one in Java

Note: This is an assignment. Hi, Ok I have this method that will create a supposedly union of 2 sets. i mport java.io.*; class Set { public int numberOfElements; public String[] setElements; public int maxNumberOfElements; // constructor for our Set class public Set(int numberOfE, int setE, ...

jQuery: Using normal function value as jquery value

Essentially i'm trying to get the value 'col' that is set in the html, and use it as the value for backgroundColor. Here's the script: function bgc(col) { $("#BG") .animate({ backgroundColor: "col" }, 1000) } Here's the html: <div id="BG"> <a href="#" onclick="bgc(#ffffff);"></a> </div> Any help would be great, i've be...

jQuery: How to check if a value exists in an array?

Hello, I am trying to write a simple input field validation plugin at the moment (more of a learning exercise really) and thought this would not be too hard, seeing as all I should have to do is: Get input fields Store them in array with each one's value On submit of form check if array contains any empty strings But I seem to fail ...

flex checkbox value not selected from database

Hi, I have a small flex datagrid. The dataProvider is an xmlList. I have two columns, userList and user permissions. The user permissions column as checkboxes. The values for the checkbox are stored as 0 and 1 in mySQL. While returning it from PHP, I am converting them to true or false. Its returning the values correctly to the frontend....

Get drop down menu value on Jqery

Hi all Got a simple question. I would like to get a drop down menu value when a use clicks it. I tried to write the code on my own, but couldn't do it. Any helps would be appreciated. My Jquery $("#week").change(function(){ var input=$("week: select").val(); alert(input); //display undefiend My Html <form id="week...

PHP echo query result in Class??

Hi all I have a question about PHP Class. I am trying to get the result from Mysql via PHP. I would like to know if the best practice is to display the result inside the Class or store the result and handle it in html. For example, display result inside the Class class Schedule { public $currentWeek; functio...

NULL-keys for key/value table

(Using Oracle) I have a table with key/value pairs like this: create table MESSAGE_INDEX ( KEY VARCHAR2(256) not null, VALUE VARCHAR2(4000) not null, MESSAGE_ID NUMBER not null ) I now want to find all the messages where key = 'someKey' and value is 'val1', 'val2' or 'val3' - OR value is null in...

Javascript replace using regexp

<input type="text" value="[tabelas][something][oas]" id="allInput"> <script type="text/javascript"> allInput = document.getElementById('allInput'); var nivel = new Array('tabelas', 'produto'); for (var i =0; i < nivel.length ; i++ ) { alert(" oi => " + allInput.value + " <-- " + nivel[i]) ; var re = new RegExp("^\[" + nivel[i] + "\...

javascript for (i = 0; i < XXX.length; i++) -> length question

for (m = 0; m < troopsCount.length; m++) { //FM_log(7,"i="+i+" m="+m); //FM_log(7,"tipoTropaPrioritaria[m] = "+tipoTropaPrioritaria[m]); //FM_log(7,"troopsCount[m] = "+troopsCount[m]); //FM_log(7,"availableTroops[m] = "+availableTroops[m]); if ((tipoTropaPr...

stored procedure with cursor in MySQL

Can I use Cursor with stored procedure in MySQL? And can I receive the output values from it? ...

Value of unassigned non-nullable variable (C#)

Just curious. If you go: string myString; Its value is null. But if you go: int myInt; What is the value of this variable in C#? Thanks David ...