Dave Posted March 16, 2009 Posted March 16, 2009 I was wanting to do some javascript then i realised on the Item Sell page there was a spelling mistake or something so i decided to add some javascript to the page. As you can see in the screenshot there is an extra area called Total Sale Price this updates when the user changes the quantity! The submit button also changes from "Sell Item" to "Sell Items" if the user is selling more then one item. Then the user will be presented with a confirm box which asks them if they want to sell X number of Item with an "Ok" button and a "Cancel" button. Preety basic javascript but im learning. Installation is simple just replace itemsell.php with this one You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Not entirely sure if this will work in all browsers but it works in IE8 and FF3 Any errors or it just not working (javascript dosen't produce errors normally just dosen't work.) reply and ill see if i can work it out (Im new to javascript :P) Have fun! If you use this please reply saying thanks or maybe give me +1 (Think its called light now) Quote
Uridium Posted March 16, 2009 Posted March 16, 2009 Re: [Mccodes V2] Item Sell Update [Javascript!] Yet another Quality product from Iamwicked +1 Quote
Dave Posted March 16, 2009 Author Posted March 16, 2009 Re: [Mccodes V2] Item Sell Update [Javascript!] Yet another Quality product from Iamwicked +1 Thanks :) Hopefully some more javascript modifactions to come. Quote
Djkanna Posted March 16, 2009 Posted March 16, 2009 Re: [Mccodes V2] Item Sell Update [Javascript!] Very nice Iam +1 Quote
Dave Posted March 16, 2009 Author Posted March 16, 2009 Re: [Mccodes V2] Item Sell Update [Javascript!] Very nice Iam +1 No problem ;). any requests for anything else to be javascripted (well to the best of my abilities xD) Quote
Mafia-Club Posted March 16, 2009 Posted March 16, 2009 Re: [Mccodes V2] Item Sell Update [Javascript!] Nice Man Keep it up Quote
TheHooch Posted March 16, 2009 Posted March 16, 2009 Re: [Mccodes V2] Item Sell Update [Javascript!] I have installed this and it works nicely. very nice iamwicked! +1 Quote
xfzn Posted March 16, 2009 Posted March 16, 2009 Re: [Mccodes V2] Item Sell Update [Javascript!] using this right now, +1 !! Quote
Karlos Posted March 16, 2009 Posted March 16, 2009 Re: [Mccodes V2] Item Sell Update [Javascript!] Sorry have to be picky :-P A client have JS turned off... Now what? Quote
Dave Posted March 16, 2009 Author Posted March 16, 2009 Re: [Mccodes V2] Item Sell Update [Javascript!] Sorry have to be picky :-P A client have JS turned off... Now what? This mod will still run without JS and not many people have JS turn of ;). Quote
AlabamaHit Posted March 16, 2009 Posted March 16, 2009 Re: [Mccodes V2] Item Sell Update [Javascript!] Nice work...Small suggestion to add though On the line You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. THey can edit the value..I suggest you change to You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. And now they can not change the value :) Quote
03laceys Posted March 16, 2009 Posted March 16, 2009 Re: [Mccodes V2] Item Sell Update [Javascript!] Sorry have to be picky :-P A client have JS turned off... Now what? This mod will still run without JS and not many people have JS turn of ;). I would re-state your statment as the statment is currently false... Not many casual/game players have javascript turned off, as i know many people that do but the statement i just provided should survice. Also it's a nice addon, but may i ask did you create this or use the one ummm i think seanybob posted for the shops? Quote
Dave Posted March 16, 2009 Author Posted March 16, 2009 Re: [Mccodes V2] Item Sell Update [Javascript!] I coded this basically all myself other then having to view a tutorial on how to stop the form submitting if you pressed canceled which was done with returning false to the button :). Quote
03laceys Posted March 18, 2009 Posted March 18, 2009 Re: [Mccodes V2] Item Sell Update [Javascript!] I coded this basically all myself other then having to view a tutorial on how to stop the form submitting if you pressed canceled which was done with returning false to the button :). In that case well done good attempt. Quote
phoenix201012 Posted March 13, 2011 Posted March 13, 2011 Is there a way you can use something like this in item send to display who you are sending to before you send. ino loads of peolpe send items to wrong person by id. Quote
rulerofzu Posted March 13, 2011 Posted March 13, 2011 Give it a go....you wont learn anything unless you try yourself! *tip.....Adapt the code to use the item send code changing the var answer! var answer = confirm("Are you sure you want to sell " + document.form.qty.value + " '.$r['itmname'].'" + plural + "?"); to var answer = confirm("Are you sure you want to send to " + document.form.qty.value + " '.$r['username'].'" + plural + "?"); Quote
phoenix201012 Posted March 13, 2011 Posted March 13, 2011 i cant get it to work could you post the full code please ino its cheeky lol Quote
rulerofzu Posted March 13, 2011 Posted March 13, 2011 Nope .....ive not done it ....just from mere deduction thats about what you would need to do. I dont wish or have any need to do this. Quote
Danny696 Posted March 13, 2011 Posted March 13, 2011 KISS!!!! when they submit the form, take the to another 'step' get the id, use that to get the name, ask them 'Are you sure you want to send 1484 items to billy?' they click yes or no... Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.