 |

|
function OnTargetDrop(){
alert(oDragItem.value); alert(oDragTarget.value); var temp = oDragTarget.value;saving a value of target div that brings the position of dragged box
if arrived target is <div class="DropTarget" value="2"> brings 2 as value
var tmp_val = oDragItem.value-0; var $node = $("#order").children().eq(temp); var org_val = $node.text()-0; $node.text(org_val+tmp_val);
oDragItem.style.position="";
oDragTarget.appendChild(oDragItem);
if (navigator.platform=="iPad") MakeDragable(oDragItem);
}
<blockquote class="FQ"><div class="FQA">Quote:</div>
<td>
{
<div class="DropTarget" value="1">
<div class="Dragable" seletable="no" style="background-color:#eee8aa;" value="10">cb13030940</div>
<div class="Dragable" seletable="no" style="background-color:#87cefa;" value="10">cb13030940</div>
<div class="Dragable" seletable="no" style="background-color:#66cdaa;" value="20">cb13030940</div>
<div class="Dragable" seletable="no" style="background-color:#eee8aa;" value="10">cb13030940</div>
<div class="Dragable" seletable="no" style="background-color:#eee8aa;" value="30">cb13030940</div>
<div class="Dragable" seletable="no" style="background-color:#87cefa;" value="20">cb13030940</div>
<div class="Dragable" seletable="no" style="background-color:#66cdaa;" value="20">cb13030940</div>
<div class="Dragable" seletable="no" style="background-color:#eee8aa;" value="10">cb13030940</div>
</div>
<blockquote class="FQ"><div class="FQA">Quote:</div></td></blockquote>
</blockquote>
<blockquote class="FQ"><div class="FQA">Quote:</div><td align="center">
<div class="DropTarget" value="2">
<div class="Dragable" seletable="no" style="background-color:#eee8aa;" value="20">cb13030940</div>
<div class="Dragable" seletable="no" style="background-color:#87cefa;" value="10">cb13030940</div>
<div class="Dragable" seletable="no" style="background-color:#66cdaa;" value="20">cb13030940</div>
<div class="Dragable" seletable="no" style="background-color:#eee8aa;" value="20">cb13030940</div>
<div class="Dragable" seletable="no" style="background-color:#87cefa;" value="20">cb13030940</div>
<div class="Dragable" seletable="no" style="background-color:#87cefa;" value="20">cb13030940</div>
<div class="Dragable" seletable="no" style="background-color:#66cdaa;" value="10">cb13030940</div>
</div>
</td></blockquote>
<blockquote class="FQ"><div class="FQA">Quote:</div>
<blockquote class="FQ"><div class="FQA">Quote:</div><%
int sum1, sum2;
%></blockquote>
<tr align="center" id="order">
<td width = "25">Order Quantity</td>
<td><%=sum1%></td>
<td><%=sum2%></td>
<td>sum3</td>
<td>sum4</td>
<td>sum5</td>
<td>sum6</td>
<td>-</td>
<td>-</td>
<td>-</td>
</tr></blockquote>
}
}// when the value gets 1, the value in the div's sum
becomes sum1. when the value gets 2, the value in the div's sum becomes sum2. when div moves, sum1 or sum2 change depends on specific value,
|
|
|
|

|
What's your question?
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|

|
can I recommend that you use.
http://jsfiddle.net/[^]
and then discuss the problem that you are having and need help with.
as if the facebook, twitter and message boards weren't enough - blogged
|
|
|
|

|
I want to add GO button. After press the go button then stage3 will open in New tab.
Please help me and add the Line in below Script and
reply on my email :abmanish71@gmail.com
<!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>
<title>Combo Boxes</title>
</head>
<body>
<form name="isc">
<select name="example" size="1" onChange="redirect(this.options.selectedIndex)">
<option selected>Select your department</option>
<option>ACCT</option>
<option>BACC</option>
<option>BMGT</option>
</select>
<select name="stage2" size="1" onChange="redirect1(this.options.selectedIndex)">
<option value=" " selected> </option>
<option value=" " selected>---Select2--------------</option>
<option value=" " selected>---Select2--------------</option>
</select>
<select name="stage3" size="1" onChange="redirect2(this.options.selectedIndex)">
<option value=" " selected> </option>
<option value=" " selected>---Select3----------------</option>
<option value=" " selected>---Select3----------------</option>
</select>
<input type="button" name="next" value="Next" onclick="window.location=stage3.options[stage3.options.selectedIndex].value;" style="font-family:Arial;Z-INDEX: 105; POSITION: absolute; TOP: 20px" enable>
<script>
<!--
/*
Triple Combo Script Credit
By Hamid Cheheltani/ JavaScript Kit (http://www.javascriptkit.com)
Visit http://javascriptkit.com for this and over 400+ other scripts
*/
var groups=document.isc.example.options.length
var group=new Array(groups)
for (i=0; i0;m--)
temp.options[m]=null
for (i=0;i0;m--)
temp1.options[m]=null
for (i=0;i
</script>
|
</form>
</body>
</html>
____________________
Thanks & Regards
Manish Kumar
E - mail : abmanish71@gmail.com
modified 7 hrs ago.
|
|
|
|

|
What do you mean by "stage3 will open in New tab?" Isn't stage3 a dropdown list?
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|

|
I'm trying to load an image and retrieve its width/height. The image appears to be okay, but width/height are zero. The image isn't part of the page (yet), I'm simply creating it for later. Anyone got any help for me?
var id = this.FileName.replace(".png", "").replace(".jpg", "") + "_" + index;
var src = this.Path + this.Filename + "?" + new Date().getTime();
this.ItemImage = new Image();
$(this.ItemImage).attr(
{
'src': src
,'id' : id
});
this.Width = $(this.ItemImage).width();
this.Height = $(this.ItemImage).height();
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997
|
|
|
|

|
John Simmons / outlaw programmer wrote: The image isn't part of the page (yet), I'm simply creating it for later.
That is the answer to your problem.
since the image isn't loaded yet the browser won't set the width and height properties. will the image ever be loaded by the browser??
maybe try something like...
$('<img />').attr('src', 'http://urdomain.com/name.jpg').load(function(){
if(true === this.complete) {
var width = this.width;
var height = this.height;
} else {
}
});
as if the facebook, twitter and message boards weren't enough - blogged
|
|
|
|

|
Your suggestion didn't work. I'm going to try adding a hidden div to the document, and then add images to that div. Maybe that will do what I need...
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997
|
|
|
|

|
John Simmons / outlaw programmer wrote: Your suggestion didn't work
what part didn't work? did you get the callback from the load event?
as if the facebook, twitter and message boards weren't enough - blogged
|
|
|
|

|
I was trying to do this:
function MyClass
{
this.property1 = 'somevalue1';
this.property2 = 'somevalue2';
this.Height = 0;
this.Width = 0;
$('<img />').attr({'id': id, 'src' : src}).load(function()
{
if (true === this.complete)
{
Width = this.width;
Height = this.height;
}
});
}
That didn't work (this.width and this.height were the expected values, but trying to assign the vars did not work. So I changed it to this:
function MyClass
{
this.property1 = 'somevalue1';
this.property2 = 'somevalue2';
var Height = 0; var Width = 0;
$('<img />').attr({'id': id, 'src' : src}).load(function()
{
if (true === this.complete)
{
Width = this.width;
Height = this.height;
}
});
this.width = function()
{
return Width;
}
this.height = function()
{
return Height;
}
}
I have no idea why I can't assign vars the way I originally tried it. IMHO, Javascript is nothing more than a hack whose main intent is to drive real programmers insane.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997
|
|
|
|

|
John Simmons / outlaw programmer wrote: $('<img />').attr({'id': id, 'src' : src}).load(function()
{
if (true === this.complete)
{
Width = this.width;
Height = this.height;
}
});
did you account for the fact that the .load(...) is an asynchronous function?? the other thing of course is putting a break point in the response for the load function.
maybe you are getting a bad response from the load response because it's pathed out wrong??
as if the facebook, twitter and message boards weren't enough - blogged
|
|
|
|

|
I want to Add Number of Days with the Date object and get the New Date. i used this method to add Days
FromDate.setDate(FromDate.getDate() +12)
But this method is not working, if the month is February
EG: if the From Date is 20-02-2013, if i add 12 Days with this date, will get result as 01-03-2013.
Is there any other method to add days and check its leap year or not
|
|
|
|

|
Are you sure you're looking at the correct month? In JavaScript, the Date object uses a zero-based month, so if getMonth returns 2, the date is in March.
var date = new Date(2012, 01, 20);
date.setDate(date.getDate() + 12);
alert(date);
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|

|
Can you give an example of your code that isn't working?? I tried the following and it all appears to be working just fine.
http://jsfiddle.net/SrVvn/[^]
as if the facebook, twitter and message boards weren't enough - blogged
|
|
|
|

|
Hi Robymon,
The example you have given is incorrect.
Adding 12 days to 20-02-2013 will not give result as 01-03-2013, but will give 04-03-2013
The solutions given by "Richard Deeming" and "Dennis E White" are correct.
Thanks & Regards,
Niral Soni
|
|
|
|

|
hi to all
i have a string with this format
x=numbery=datez=number...
for example of this string can be :
x=123y=2013/02/01z=12345p=111
i want a function that get me this
x=123
y=2013/02/01
z=12345
p=111
how can i do this?
note to this point that my string can not be change and add extra character to this string
thanks in advance
|
|
|
|

|
There is usually many ways to do string manipulation but one way would be to split on the = and then you'll have the rightmost character to be the starting of your next string. You'll have to put in a case for the first one.
Or, just loop through each character and process.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|

|
you have to define what are the valid characters that can be on the left hand side of the '=' sign. in other words can you have something like the following?
pa1n=1234h1nd=4321gr33d=6789
pa1n=1234
h1nd=4321
gr33d=6789
that gets a lot more difficult vs if you only allow stuff on the left to be alpha characters and then stuff on the right to be numeric and special characters.
sounds like a homework question from a programming class.
as if the facebook, twitter and message boards weren't enough - blogged
|
|
|
|

|
function splitString(myStr) {
var regex = new RegExp(/[a-z]+[0-9]*[a-z]*=/ig);
var keyPairs = myStr.match(regex).join('').split('=');
var valuePairs = myStr.split(regex);
document.write('======== Start ==========<br/>');
document.write('INPUT: ' + myStr + '<br/>');
var map = {};
for(var i = 0; i < keyPairs.length - 1; i++) {
map[keyPairs[i]] = valuePairs[i+1];
}
for(key in map) {
document.write(key + ' = ' + map[key] + '<br/>');
}
document.write('======== End ==========<br/><br/>');
}
splitString('x=123y=2013/02/01z=12345p=111');
splitString('pa1n=1234h1nd=4321gr33d=6789');
Thanks & Regards,
Niral Soni
|
|
|
|

|
I have the following code. The problem is that the xml file is being read (it's displayed in FireBug's Console tab), but the success code is not being executed (I can't step through it in the debugger). What am I doing wrong?
$.ajax(
{
type: "GET",
url: _cfgDataFile,
dataType: "xml",
success: function(xml)
{
var configNodes = $(xml).find('Config');
parseConfigNodes(configNodes);
var imageNodes = $(xml).find('Images');
parseImages(imageNodes);
var dataNodes = $(xml).find('Data');
parseData(dataNodes);
}
});
(I'm using FireFox/Firebug for debugging.)
EDIT =====================================
I added code to get any error that might be happening, and this is what was returned:
[Exception... "Failure" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: http://localhost:1437/testwebsite/Scripts/jquery-2.0.0.js :: .send :: line 7713" data: no]
It turns out that the problem is actually in FireFox/FireBug. In IE, the code works fine. The world is now officially inside out because FireFox has now managed to out-suck IE.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997
modified 3 days ago.
|
|
|
|

|
John Simmons / outlaw programmer wrote: It turns out that the problem is actually in FireFox/FireBug. In IE, the code works fine. The world is now officially inside out because FireFox has now managed to out-suck IE.
Have you tried this in Chrome?? I am a bigger fan of trusting V8 vs the firefox or IE javascript engines.
At first glance it doesn't look like you are doing anything wrong. I don't see which domain you are heading to and where you are starting from. Typically that error message comes when you are doing cross-domain stuff and most security settings prevent this from happening.
as if the facebook, twitter and message boards weren't enough - blogged
|
|
|
|

|
The file I'm trying to load is in the same folder as the script. Domains shouldn't be an issue (as far as I know).
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997
|
|
|
|
|

|
Haven't tried it with chrome. I'm okay with using IE (v10) for now. Will check it against chrome later (maybe at home tonight), but FF is the only browser I've seen this mentioned for. I don't like Chrome, mostly I haven't sat down and tried to finger out how to make the search bar visible *all* of the time.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997
|
|
|
|

|
John Simmons / outlaw programmer wrote: I don't like Chrome
I kind of feel the same about IE.
I like Chrome for it's development tools which IMO are far superior to IE and much better than what you get with Firefox. I used to use Firefox/Firebug because it was better than what IE gave... go figure.
I am sure in the future my browser preference will change again.
as if the facebook, twitter and message boards weren't enough - blogged
|
|
|
|
 |