Ritu Singh
Problem:
In Laravel blade I have a button that if record is not empty, it calls a JQuery function
JQuery function
The function works good except when the record is empty I get error
I checked the variable $first_step_validation and found it null, so why the function was called from the first place?
Also if I change the variables in the function from
To
The error goes away, but I get console error
What I'm doing wrong? Please help!
Solution:
$first_step_validation is null when the data is empty. you should call your function only when $first_step_validation is not null
Suggested blogs:
>How to Set up the local environment for Angular development?
>How to solve encoding issue when writing to a text file, with Python?
>How to solve problems with Python syntax while writing a calculator app?-Python
>How to solve the encoding issue when writing to a text file, with Python?
>How to solve the issue of producing the wrong output value in PHP?
>How to solve XGBoost model training fails in Python
>How to Upload files and JSON data in the same request with Angular?
>How to Use RTK Queries in a React App?
>How you can create array with associative array in other array php?
>How you can send email from a shared inbox in Python