Skip to content
Advertisement

Using PHP to validate range slider

I have a simple range slider that allows a user to select an age

JavaScript

And I use JavaScript update a label with the value of the slider

JavaScript

I’m trying to use PHP to check the value of the slider and validate whether it’s between 16 and 90 but I keep getting an error that “age” doesn’t exist.

This is the PHP:

JavaScript

Not really sure where to go from here because this method has been working for other values in the form.

Advertisement

Answer

You have to make change some portion in HTML Code.

JavaScript

hear you have to replace name="vol" to name="age". I think after this kind of change in code your code works fine.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement