Portal Home > Knowledgebase > Articles Database > some javascript help needed please


some javascript help needed please




Posted by SoftDux, 02-29-2008, 09:01 AM
Hi all I have a strange problem with a simple piece of javascript, and I don't know why it' behaving like it is. I need to dispence stock to a client, but the stock is allocated to particular batches, and I don't want the user to allocate more stock than a certain batch has. Here's the script: So, let's say stock = 2500, and qty = 300, then the argument should be valid, but it gives me an error. I've playd around with various combinations, and come to the following conclusion: The script above only reads the 1st bit of the value. So, on stock=2500 & qty = 100, the script goes through, but on stock = 2500 & qty = 300, it gives an error. It even gives an error if qty=3 / 4 / 6 / 40 / 500 / etc. But, 1 / 10 / 14 / 125 / etc works fine. Here's a full working sample:

Posted by activelobby4u, 02-29-2008, 09:39 PM
I suggest you try the programming forum as well

Posted by bear, 02-29-2008, 09:52 PM
Moved it there instead.

Posted by activelobby4u, 02-29-2008, 09:54 PM
lol..missed that possibility

Posted by dollar, 03-01-2008, 03:16 AM
Try:



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
setting up apache (Views: 689)
SSL setup (Views: 658)