Can anyone hide listings in the donation select dropdown box?

Options

My company has two websites, a US and a Canadian.  For Canadians to be able to have their donation be tax-deductible they have to donate through our Canadian site.  We have links to our Canadian site on our US donation forms, but in order to keep people from donating from our US site we would like to remove the Canada option from the 'Country' dropdown.

Does anyone know of a way to hide this particular option in that select box so that it wont display on our US site?

Amy

Tagged:

Comments

  • Amy,

    You can do that pretty easily with a little JavaScript:



    <script type="text/javascript">
    addOnLoadHandler(function(){
    var i;
    var allOptions=document.getElementById('ProcessForm').getElementsByTagName('option');
    for(i in allOptions){
    if(allOptions.value&&allOptions.value=='Canada'){
    allOptions.parentNode.removeChild(allOptions);
    }
    }
    });
    </script>
  • Noah Cooper:

    Amy,

    You can do that pretty easily with a little JavaScript&colon;



    <script type="text/javascript">
    addOnLoadHandler(function(){
    var i;
    var allOptions=document.getElementById('ProcessForm').getElementsByTagName('option');
    for(i in allOptions){
    if(allOptions.value&&allOptions.value=='Canada'){
    allOptions.parentNode.removeChild(allOptions);
    }
    }
    });
    </script>

    Thanks, Noah.  This helped a lot!

  • Noah Cooper:

    Amy,

    You can do that pretty easily with a little JavaScript&colon;



    <script type="text/javascript">
    addOnLoadHandler(function(){
    var i;
    var allOptions=document.getElementById('ProcessForm').getElementsByTagName('option');
    for(i in allOptions){
    if(allOptions.value&&allOptions.value=='Canada'){
    allOptions.parentNode.removeChild(allOptions);
    }
    }
    });
    </script>

    I'm also interested in this. Where do i need to insert the script to get the form to read it? Do i add an HTML component right before this form field?

  • debi :

    I'm also interested in this. Where do i need to insert the script to get the form to read it? Do i add an HTML component right before this form field?

    You've got it -- you'd put this script into an HTML Caption element. Whether it's before or after the field doesn't really matter.

Categories