render() {
        this.button.value = `${this.content}`
        this.button.classList.remove("gus_button_outlined")
        this.button.classList.remove("gus_button_noborder")
        if (this.outlined) {
            this.button.classList.add("gus_button_outlined")
        }
        else {
            if (this.noBorder) {
                this.button.classList.add("gus_button_noborder")
            }
        }

        if (this.firstRender) {
            this.button.addEventListener("click", (e) => {
                if (this.type === "submit") { // Form
                    var form = this.getParentForm(this)
    
                    var fakeTextFields = form.getElementsByTagName("gus-text-field")
    
                    for (var i = 0; i < fakeTextFields.length; i++) {
                        var realTextField = document.createElement("input")
                        realTextField.type = "text"
    
                        realTextField.value = fakeTextFields[i].value

                        realTextField.name = fakeTextFields[i].getAttribute("name")

                        realTextField.style.display = "none"
    
                        form.appendChild(realTextField)
                    }
    
                    form.submit()
                }
            })
        }

        this.firstRender = false
    }
// Re-render the whole checkbox
Re-render the whole checkbox
Re - render the whole checkbox
render() {
        this.button.value = `${this.content}`
        this.button.classList.remove("gus_button_outlined")
        this.button.classList.remove("gus_button_noborder")
        if (this.outlined) {
            this.button.classList.add("gus_button_outlined")
        }
        else {
            if (this.noBorder) {
                this.button.classList.add("gus_button_noborder")
            }
        }
        if (this.firstRender) {
            this.button.addEventListener("click", (e) => {
                if (this.type === "submit") { 
                    var form = this.getParentForm(this)
                    var fakeTextFields = form.getElementsByTagName("gus-text-field")
                    for (var i = 0; i < fakeTextFields.length; i++) {
                        var realTextField = document.createElement("input")
                        realTextField.type = "text"
                        realTextField.value = fakeTextFields[i].value
                        realTextField.name = fakeTextFields[i].getAttribute("name")
                        realTextField.style.display = "none"
                        form.appendChild(realTextField)
                    }
                    form.submit()
                }
            })
        }
        this.firstRender = false
    }
render ( ) { this . button . value = ` ${ this . content } ` this . button . classList . remove ( "gus_button_outlined" ) this . button . classList . remove ( "gus_button_noborder" ) if ( this . outlined ) { this . button . classList . add ( "gus_button_outlined" ) } else { if ( this . noBorder ) { this . button . classList . add ( "gus_button_noborder" ) } } if ( this . firstRender ) { this . button . addEventListener ( "click" , ( e ) => { if ( this . type === "submit" ) { var form = this . getParentForm ( this ) var fakeTextFields = form . getElementsByTagName ( "gus-text-field" ) for ( var i = 0 ; i < fakeTextFields . length ; i ++ ) { var realTextField = document . createElement ( "input" ) realTextField . type = "text" realTextField . value = fakeTextFields [ i ] . value realTextField . name = fakeTextFields [ i ] . getAttribute ( "name" ) realTextField . style . display = "none" form . appendChild ( realTextField ) } form . submit ( ) } } ) } this . firstRender = false }
Re-render the whole checkbox
Re - render the whole checkbox
// Form