If Statement & Dropdown Values

Hi all,

Currently busy with the Becoming a Reactive Web Developer Guided Path and stumbled on a challenge I am struggling to get working.

I am busy with adding a GPU page that will update the information to the database. But I am my validation isn't working. Basically, I am checking for the keyword "GeForce" and then checking if AMD is selected. If so, I make the dropdown validation false and prompt the user with the message stating it needs to be an NVIDIA GPU of course, but changing back to NVIDIA still throws the validation error.





Could anyone perhaps point me in the right direction in order to fix this?

Thanks,
Andre


Solution

As I expected there was a problem with my if-statement and adjusted accordingly, now it works as expected thanks to the Debugger Tool.

@Bogdan Boglea thank you for the tip on resetting the form input to true again.




You're welcome, glad I could help :)

Hey Andre,


From what I see the Form is not reset to Valid ever again, that's why you still see the validation message. You could try refreshing your block/screen entirely or just resetting the Form.Valid to True value before performing the validations again.


Regards,

Bogdan

That's a good point didn't think of that, presumed it would reset automatically if it starts from the beginning again.

Not sure if this is correct, but it still prompts the validation error. I think the problem lies in my if-statement.

Here is my data structure of the two tables:

Parent table consisting of the ID, model, brand and then the reference table simply consisting of the values AMD and NVIDIA.

Solution

As I expected there was a problem with my if-statement and adjusted accordingly, now it works as expected thanks to the Debugger Tool.

@Bogdan Boglea thank you for the tip on resetting the form input to true again.




You're welcome, glad I could help :)

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.