Skip to content

Wordpress Plugin Javascript problem #121034

Discussion options

You must be logged in to vote

Ohh okay. I saw in the console there's this error: Uncaught TypeError: Cannot read properties of undefined (reading 'value')

It's not getting the value for these 2 variables:

var selectedInkOption = inkCostElement.options[inkCostElement.selectedIndex];
var selectedInkOriginalPrice = parseFloat(selectedInkOption.value) || 0;

var selectedPaperOption = paperCostElement.options[paperCostElement.selectedIndex];
var selectedPaperOriginalPrice = parseFloat(selectedPaperOption.value) || 0;

So you may not be targeting selectedInkOption & selectedPaperOption correctly

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@LinkDirect04
Comment options

@ebndev
Comment options

Answer selected by ebndev
@LinkDirect04
Comment options

@ebndev
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Programming Help Programming languages, open source, and software development.
2 participants