js/script.js
// use data from the selected book to populate the form accordingly

use data from the selected book to populate the form accordingly
use data from the selected book to populate the form accordingly
function populateForm ( selectedBookNumber ) {
   titleInput.value = books[selectedBookNumber][titleProperty];
   readInput.checked = books[selectedBookNumber][readProperty];
   ownInput.checked = books[selectedBookNumber][ownProperty];
   loanedInput.checked = books[selectedBookNumber][loanedProperty];
   wishlistInput.checked = books[selectedBookNumber][wishlistProperty];
   switch ( books[selectedBookNumber][readabilityEaseProperty] ) {
      case pageTurnerInput.value :
	 pageTurnerInput.checked = true;
	 break;
      case variablePacingInput.value :
	 variablePacingInput.checked = true;
	 break;
      case hardSlogInput.value :
	 hardSlogInput.checked = true;
	 break;
   }
   switch ( books[selectedBookNumber][insightsOfferedProperty] ) {
      case quiteInfluentialInput.value :
	 quiteInfluentialInput.checked = true;
	 break;
      case someValueInput.value :
	 someValueInput.checked = true;
	 break;
      case lackedSubstanceInput.value :
	 lackedSubstanceInput.checked = true;
	 break;
   }
   switch ( books[selectedBookNumber][enjoymentLevelProperty] ) {
      case thoroughlyRelishedInput.value :
	 thoroughlyRelishedInput.checked = true;
	 break;
      case likedModeratelyInput.value :
	 likedModeratelyInput.checked = true;
	 break;
      case sufferedThroughInput.value :
	 sufferedThroughInput.checked = true;
	 break;
   }
}
function populateForm ( selectedBookNumber ) { titleInput . value = books [ selectedBookNumber ] [ titleProperty ] ; readInput . checked = books [ selectedBookNumber ] [ readProperty ] ; ownInput . checked = books [ selectedBookNumber ] [ ownProperty ] ; loanedInput . checked = books [ selectedBookNumber ] [ loanedProperty ] ; wishlistInput . checked = books [ selectedBookNumber ] [ wishlistProperty ] ; switch ( books [ selectedBookNumber ] [ readabilityEaseProperty ] ) { case pageTurnerInput . value : pageTurnerInput . checked = true ; break ; case variablePacingInput . value : variablePacingInput . checked = true ; break ; case hardSlogInput . value : hardSlogInput . checked = true ; break ; } switch ( books [ selectedBookNumber ] [ insightsOfferedProperty ] ) { case quiteInfluentialInput . value : quiteInfluentialInput . checked = true ; break ; case someValueInput . value : someValueInput . checked = true ; break ; case lackedSubstanceInput . value : lackedSubstanceInput . checked = true ; break ; } switch ( books [ selectedBookNumber ] [ enjoymentLevelProperty ] ) { case thoroughlyRelishedInput . value : thoroughlyRelishedInput . checked = true ; break ; case likedModeratelyInput . value : likedModeratelyInput . checked = true ; break ; case sufferedThroughInput . value : sufferedThroughInput . checked = true ; break ; } }
use data from the selected book to populate the form accordingly
use data from the selected book to populate the form accordingly