src/components/form/characterdetails.js
//function used to hide/show different generation method fields of ability scores (Needs an update when Point Buy is implemented)
function used to hide/show different generation method fields of ability scores (Needs an update when Point Buy is implemented)
function used to hide / show different generation method fields of ability scores ( Needs an update when Point Buy is implemented )
abilityGenMethod(event) {
    this.setState({genMethod: [event.target.value]})
    var elementList = document.getElementById("form").elements
    if (event.target.value === "Roll") {
      this.setState({rollDisplay: true})
      for (var i = 15; i < elementList.length-8; i++) {
        elementList[i].style.display = 'block'
      }
    }
    else if(event.target.value === "Point Buy") {
      this.setState({rollDisplay: false})
      for (var i = 15; i < elementList.length-8; i++) {
        elementList[i].style.display = 'none'
      }
    }
    else {
      this.setState({rollDisplay: false})
      for (var i = 15; i < elementList.length-8; i++) {
        elementList[i].style.display = 'none'
      }
    }
  }
abilityGenMethod ( event ) { this . setState ( { genMethod : [ event . target . value ] } ) var elementList = document . getElementById ( "form" ) . elements if ( event . target . value === "Roll" ) { this . setState ( { rollDisplay : true } ) for ( var i = 15 ; i < elementList . length - 8 ; i ++ ) { elementList [ i ] . style . display = 'block' } } else if ( event . target . value === "Point Buy" ) { this . setState ( { rollDisplay : false } ) for ( var i = 15 ; i < elementList . length - 8 ; i ++ ) { elementList [ i ] . style . display = 'none' } } else { this . setState ( { rollDisplay : false } ) for ( var i = 15 ; i < elementList . length - 8 ; i ++ ) { elementList [ i ] . style . display = 'none' } } }
function used to hide/show different generation method fields of ability scores (Needs an update when Point Buy is implemented)
function used to hide / show different generation method fields of ability scores ( Needs an update when Point Buy is implemented )
//Puts all elements/fields into a list/array //Checks which generation method is selected //iterates through element list and makes elements for Rolling visible  //(elementList.length-8 skips the last 8 elements which are Modifier fields) //iterates through element list and makes elements for Rolling invisible //iterates through element list and makes elements for Rolling invisible