Need to make PayPal optional field mandatory

Posted on 2011-10-18
Last Modified: 2012-05-12
I am using PayPal's optional fields (os1) and need to check to make sure it's the correct length and is valid.  If not, I want to display a pop-up message as to what's wrong.

How do I do that?  (sorry for the lame question, but I'm lost on this one!).
Question by:rmmarsh
    LVL 28

    Expert Comment

    You can use javascript and do document.getElementById("OSid") to get the value of the field and you can wire up an OnSubmit action to intercept the post of the form.

    Author Comment

    Is it possible you can give me a sample of the code to do this?  I'm not very versed in JavaScript...

    Accepted Solution

    This is how it's done... thanks anyway...

    Author Closing Comment

    Nobody else had an answer with an example...

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
    Someone recently asked me about how to display a progress indicator on a page while an iframe is loading. And I remember when I first came across this myself. It was a bit tricky to get my head around, but really, it's very simple. The most impor…
    In this tutorial viewers will learn how to define a gradient in CSS. Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Gradient. Define the background as "linear-gradient(to right, #ee3668, black)". Ensure you …
    In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now