Topic

Auctions: Price Validation

Although you cannot type non-numeric values into price field, you can paste text in and submit.  Upon submission page returns to "Start a new auction" screen with message "Error posting auction: bad_cost".

Posted 17 months ago by IncredibleSpam Subscriber! | Permalink

Replies

  • This isn't really a bug per se - copy/paste does an end-run round any sensible validation we can do in javascript.

    I'm reminded of the old joke...

    "Doctor, doctor! It hurts when I bend my arm like this..."

    "Don't do that, then!"

    There's a prettier error message in place if you do copy/paste text into the field now, though :)
    Posted 17 months ago by hitherto Subscriber! | Permalink
  • I agree its not a "bug", and perhaps I am being picky being a developer myself, but I know from previous experience that users will do some crazy things.  I would have said though that some jQuery could be added to stop the page submission based on the value in the text box e.g.

            $('#sellform').submit(function () {
                var elCost = $("input[id$=cost-input]").val();
                if (isNaN(elCost)) {
                    alert('Not a number crazy fool!');
                    return false;
                } else {
                    alert('You may pass...');
                    return true;
                }
            });

    This is obviously a nice to have as you are doing something with the submission to cater for it.
    Posted 17 months ago by IncredibleSpam Subscriber! | Permalink
  • Better 'Not a number crazy fool!' to be replaced with --> Thou shalt not pass! :D
    Posted 17 months ago by Lilla My Subscriber! | Permalink