www.webdeveloper.com
Results 1 to 2 of 2

Thread: IE not returning right variable

Hybrid View

  1. #1
    Join Date
    Feb 2012
    Posts
    1

    Arrow IE not returning right variable

    We have a script that basically pulls in, through use of API, Participation Type ID's, presents the user with the options, the user selects and the page refreshes and includes the variable "participation_type=XXXX" into the URL to allow the user to continue registration. IE is refreshing the page and does everything correctly up to the point of actually filling in the X's above with the correct ID. This works OK in Firefox, Chrome and Safari. Just not IE. I am placing the section of the code in it's entirety below But I believe the problem lies somewhere in the range of lines 120-130. Any help would be GREATLY appreciated! Thank you in advance!

    Code:
    var api = new ConvioApiClient('id', 'api_client.html', 'json');
    var participation_id = null;
    var fr_id = null;
    var cons_id = null;
    var sso_auth_code = null;
    var team_search_results_rows = 0;
    var team_id = null;
    var team_name = null;
    var event_name = null;
    var participation_name = null;
    var activeDiv = null;
    var new_constituent = false;
    var is_captain = false;
    var fee = 0;
    var additional_gift = 0;
    var event_has_questions = true;
    var event_requires_promo_code = false;
    var event_supports_upsells = false;
    var event_supports_secondary_registration = false;
    var user_can_select_team = true;
    var user_can_select_company = true;
    var user_can_select_team_division = true;
    var user_can_create_team_password = true;
    var user_must_accept_waiver = true;
    var event_has_discounts = true;
    var process_registration_request = '';
    var populate_team_pages_called = false;
    
    function toggleDiv(hideDiv, showDiv) {
        if (hideDiv !== null) {
            document.getElementById(hideDiv).setAttribute('style', 'display:none;');
        }
        if (showDiv !== null) {
            document.getElementById(showDiv).setAttribute('style', 'display:block;');
        }
        activeDiv = showDiv;
        return;
    }
    
    function getParm(name) {
        var regexS = "[\\?&]" + name + "=([^&#]*)";
        var regex = new RegExp(regexS);
    
        var results = regex.exec(window.location.search);
        if (results == null) {
            return "";
        }
        return results[1];
    }
    
    $(function () {
    
        $(document).ready(function () {
            activeDiv = 'search_for_team_div';
            fr_id = getParm('fr_id');
            participation_id = getParm('participation_id');
    
            if (fr_id == "") {
                window.location = 'find_event.html';
            }
    
            parms = {
                fr_id: fr_id,
                participation_id: participation_id
            };
    
            if (parms.fr_id != null) {
                api.callTeamraiserAPI("getParticipationTypes", function (response, status) {
                    console.log('getParticipationTypes:', status);
                    console.log(response);
    
                    //find participation type
                    var i = 0;
                    var r = null;
                    var types = jQuery.makeArray(response.getParticipationTypesResponse.participationType);
                    var activeCount = 0;
                    var activeIndex = 0;
                    for (i = 0; i < types.length; i++) {
                        if (types[i].id == participation_id) {
                            //found the participation type passed in, grab it and bust out
                            r = types[i];
                            activeCount = 1;
                            break;
                        }
    
                        if (types[i].active == 'true') {
                            //set up particpation type selector
                            var dlg = document.getElementById('participation_type_dialog');
                            var elem = document.createElement('input');
                            activeCount++;
                            activeIndex = i;
                            elem.type = 'checkbox';
                            elem.id = 'part_index_' + i;
                            elem.setAttribute('onClick', 'participation_id=' + types[i].id + ';');
                            dlg.appendChild(elem);
                            elem = document.createElement('label');
                            elem.setAttribute('for', 'part_index_' + i);
                            elem.innerHTML = types[i].name;
                            dlg.appendChild(elem);
                            elem = document.createElement('p');
                            elem.innerHTML = types[i].description;
                            dlg.appendChild(elem);
                        }
                    }
    
                    if (r == null) {
                        if (activeCount < 2) {
                            //there was only one active participation type, so use it
                            r = types[activeIndex];
                            participation_id = r.id;
                            parseParticipationType(r);
                        } else {
                            //display the participation type selector dialog
                            $("#participation_type_dialog").dialog({
                                modal: true,
                                width: 600,
                                buttons: [{
                                    text: "OK",
                                    click: function () {
                                        window.location = 'registration.html?fr_id=' + fr_id + '&participation_id=' + participation_id;
                                    }
                                }]
                            });
                        }
                    } else {
                        parseParticipationType(r);
                    }
    
                    return false;
                }, parms);
            }
            return;
        });

  2. #2
    Join Date
    Feb 2012
    Location
    Tallahassee, FL
    Posts
    280
    Can you post the form as well? I want to try running it because it looks fine.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles