Jump to content
MakeWebGames

[Mccodes V2] Item Sell Update [Javascript!]


Recommended Posts

Posted

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.

9469003746_b.jpg

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)

Posted

Re: [Mccodes V2] Item Sell Update [Javascript!]

Yet another Quality product from Iamwicked

+1

Thanks :) Hopefully some more javascript modifactions to come.

Posted

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)

Posted

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 ;).

Posted

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 :)

Posted

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?

Posted

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 :).

Posted

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.

  • 1 year later...
Posted

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 + "?");

Posted

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...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...