Jump to content
  • 0

Change Checkbox Value


Scottster

Question

I have the following code:

 

function CalcArrivalDate(){
    var v_LeadTime = document.getElementById("InsertRecordLeadTime").value;
    var v_ShipMethod = document.getElementById("InsertRecordShipMethod").value;
    var v_NewDate = new Date();

    if(typeof Date.today() != 'undefined'){
        v_LeadTime = (v_LeadTime ? Number(v_LeadTime) : 0);
        if(v_ShipMethod){
            switch(v_ShipMethod) {
                case 'Ocean':
                    document.getElementById('InsertRecordStage7Completed').checked = false;
                    v_NewDate = Date.today().addDays(v_LeadTime + 37);
                    break;
                case 'Air Priority':
                    document.getElementById('InsertRecordStage7Completed').checked = false;
                    v_NewDate = Date.today().addDays(v_LeadTime + 3);
                    var x = true;
                    break;
                case 'Air Economy':
                    document.getElementById('InsertRecordStage7Completed').checked = True;
                    v_NewDate = Date.today().addDays(v_LeadTime + 6);
                    var x = true;
                    break;
                default:
                    break;
            }
            document.getElementById("InsertRecordEstimatedArrivalDate").value = v_NewDate.toString('MM/dd/yyyy');

        }

    }else{
        console.log('Date Library is not loaded');
    }
}

 

When the selection is made, the date changes correctly.  The 'InsertRecordStage7Completed', however, does not.  The debugging does not show any errors, so I am not sure where I went wrong.  I have tried 'document.getElementById('InsertRecordStage7Completed').value = True;', but still no luck.

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...