What do you mean by wrong filtering? It's returning something it shouldn't or not returning something that it should?
Anyway, I would try DateTimePicker.Value.ToString("yyyy-MM-dd")
What do you mean by wrong filtering? It's returning something it shouldn't or not returning something that it should?
Anyway, I would try DateTimePicker.Value.ToString("yyyy-MM-dd")
try this:
var markerId = $(this).children().eq(0).attr("rel");
I think you're missunderstaing somethings...
First, you are not using the array as an array, but as an simple object(var array = new Object() would be prettier).
Second, pepsi is not a property of "array.drinks", it's the value.
What I think you want:
var array = new Object();
array.fruit= ["banana", "apple"];
array.vegies = ["cucumber", "carrot", "tomatos", "potatos"];
array.drinks = ["coke", "pepsi"];
outerloop:
for(var prop in array){
var obj = array[prop];
for(var index in obj) {
var val = obj[index];
if ( val == "pepsi" ){
alert(val + " found");
break outerloop;
}
}
}
Hope it helps.
Hi knitex, your code has a number of issues, so I thought about what you were trying to do and made it happen.
I hope this is what you need:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
<style type="text/css">
#theform {
font-family: "Courier New", Courier, monospace;
font-size: 12px;
}
</style>
<script type = "text/javascript">
function addText( evt ){
var radioButtons = document.getElementsByName('choice')
var choice = ""
for( var x = 0; x < radioButtons.length; x++){
if(radioButtons[x].checked){
choice = radioButtons[x].value
break;
}
}
var form = evt.target.form; // Form
var div = document.getElementById("change"); // Div that will hold the paragraphs
var textNum = div.getElementsByTagName('p'); // Get only P inside 'change'
var text = form.text.value; // Text of text area
var position = form.position.value; // Position
if(choice == "add"){
var p = "<p>" + text + "</p>";
div.innerHTML = div.innerHTML + p;
}
else if(choice == "delete"){
var node = textNum[position]; // Get P from position
node.parentNode.removeChild(node); // Remove P
}
else if(choice == "insert"){
var p=document.createElement("p"); // Create P
p.innerHTML = text;
if ( textNum.length > 0 && position + 1 < textNum.length ) // If P is between others
{
div.insertBefore(p, textNum[position+1]);
}
else // If P is first or last
{
div.appendChild(p);
}
}
else if(choice == "replace"){
var node = textNum[position];
node.innerHTML = text; // Change text of existing P
}
refreshList();
}
// Refresh dropdown list with all existing P's …