Eye On Asia - Quality Japanese Anime Figures
Cardfight Vanguard
Rice Digital Doujin Japanese Gaming
Genki Gear - Awesome anime-styled T-shirts
Anime, manga and merchandise superstore
Anime League - Anime events and community building
UK Anime Network
|
|
|
|
|
|
|
|
UK Anime Network
Main Site Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Go Back   UK Anime Forums > General > UKA Garage

UKA Garage Need help with hardware? See if our army of boffins can help...

Reply
 
Thread Tools Display Modes
Old 29-08-2012, 02:47 PM   #1
Ross
Ed.
Site Admin
 
Ross's Avatar
 
Join Date: Jun 2004
Location: 3 floors up
Posts: 9,257
Default Little bit of javascript help?

I don't suppose anyone knows enough about Javascript to help e tweak a bit of code? It's driving me nuts.

Remuneration will of course be awarded, the nature of which will depend entirely on who helps. At the very least I'd pay for a manga/DVD of your choice (up to a sensible limit of course )
__________________
[N]eko friendly
Ross is offline   Reply With Quote
Old 29-08-2012, 02:51 PM   #2
megalomaniac
「遊びは終わりだ」
 
megalomaniac's Avatar
 
Join Date: Mar 2010
Location: Nottingham
Posts: 2,761
Default

Depends what it is you need, but I've done my fair share of JavaScript over the years.
__________________
"If there's anything more important than my ego around, I want it caught and shot now!"
MyAnimeList | MyFigureCollection | Twitter | Tumblr | Blog
megalomaniac is offline   Reply With Quote
Old 29-08-2012, 03:21 PM   #3
Ross
Ed.
Site Admin
 
Ross's Avatar
 
Join Date: Jun 2004
Location: 3 floors up
Posts: 9,257
Default

I have a PriceNet and a PriceGross (inc VAT) box in a form, and editing one updates the other (form OnKeyUp command). we currently read the VAT rate from the product record and this works ok.

However, we now have multiple VAT levels (5% and 20%) stored in a separate table, and these are selected from a dropdown - so all I need to know is how to move the correct VAT rate from this table into the Javascript to work out the correct prices.

Is that something that sounds do-able from your perspective?
__________________
[N]eko friendly
Ross is offline   Reply With Quote
Old 29-08-2012, 03:31 PM   #4
megalomaniac
「遊びは終わりだ」
 
megalomaniac's Avatar
 
Join Date: Mar 2010
Location: Nottingham
Posts: 2,761
Default

That's something I'd probably do with some AJAX magic. But you should be able to grab the VAT rate from your dropdown with something like:

var e = document.getElementById("vatrate"); // where vatrate is your vat dropdown
var selectedRate = e.options[e.selectedIndex].value; // and the dropdown value's set to the vat rate

then calc/set the PriceGross as you always did.

also you could trigger the same function from an onchange event from the VAT select, so it updates when the VAT rate changes or the PriceX boxes change.
__________________
"If there's anything more important than my ego around, I want it caught and shot now!"
MyAnimeList | MyFigureCollection | Twitter | Tumblr | Blog

Last edited by megalomaniac; 29-08-2012 at 03:34 PM.
megalomaniac is offline   Reply With Quote
Old 29-08-2012, 03:34 PM   #5
Ross
Ed.
Site Admin
 
Ross's Avatar
 
Join Date: Jun 2004
Location: 3 floors up
Posts: 9,257
Default

I'll give that a go, thank you

Actually, nuts, I'll have to do it in the morning as I have a client house-call to make ><

Very much appreciate the help though, will let you know how I get on - compensation will be arranged
__________________
[N]eko friendly
Ross is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:37 PM.


Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.