Results 1 to 2 of 2

Thread: JavaScript

  1. #1
    Star Lounger
    Join Date
    Feb 2003
    Location
    near Blairgowrie, Perthshire, Scotland
    Posts
    72
    Thanks
    0
    Thanked 0 Times in 0 Posts

    JavaScript

    A comment and a question. I have been struggling to disable or lose focus from a PayPal form. disable doesn't seem to work but I have come up with a possible solution: if the values on a product name and quantity aren't valid, I put onMouseDown= "unfocus()" in the image tag, jump to the appropriate alert and set the focus on the quantity box where appropriate. That's one way of killing two electronic birds with one stone. Has anyone a better idea? Code snippet follows: the first test is on the product (proflist) and the second on the quantity (howmuch).

    Rex Last

    function unfocus()
    {

    if (document.proflist.profiles.value == "x")
    {
    alert("Please select a Profile from the list");

    }
    else if (isNaN(document.howmuch.quantity.value) || document.howmuch.quantity.value==0)
    {
    alert("Please type a valid number in the box");
    document.howmuch.quantity.value= "";
    document.howmuch.quantity.focus();
    }

  2. #2
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: JavaScript

    I have a couple of questions for you:
    1) What do you mean by a PayPal form? Is this a custom form that you have control over, or is it a component supplied by PayPal?
    2) Can you provide more details about your goal - i.e. beyond the obvious, what's the reason behind needing to perform this task client-side?
    3) Are you using a server-side platform (i.e. ASP.NET, Classic ASP, CGI/PERL, etc)?

    Thanks <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •