Registration page Update: Button for Resale Certificate upload

Adding a button for uploading the resale certificate in the login register page. The button should be visible only when user selects the country: ‘United States’, for all other countries the button should be hidden.

Solution:

Create button on the template file of login register and also add style in the SCSS file also and need to add an event in the view file of login register page, and also need create a function based on the event. Event here is when user change the country while filling the registration form. so for that action a function will be triggered.

code:

View file:

events: {
    'change #register-country': 'showButton',
    },
showButton : function()
{

    var x = document.getElementById("register-country").value;
    console.log(x);
    $("#resaleButton").show();
    if (x==="US")
    {
        $("#resaleButton").show();
    }
    else{
        $("#resaleButton").hide();
    }

}

Template file:

<div class="uploadbutton">
       <button class="resaleUpload" id= "resaleButton" type="button" >
       {{translate 'Upload Certificate'}}
       </button>
</div>

Scss file:

.uploadbutton{
	width: 784.8px;
	height: 25.42px;
	text-align: center;
	margin: 0 auto;
	@media (max-width: $screen-sm-min) { width: 50%; }
}
.resaleUpload{
	@extend .button-large;
	@extend .button-primary;
        background-color: red;
        border: 0px solid white;
        padding: 12px;
        font-weight: 600;
        border-radius: 5px;
        text-align: -webkit-center;"
}

Leave a comment

Your email address will not be published. Required fields are marked *