You know setError works on EditText and TextView. If the spinner has a list of TextView or EditText item, then you simply have to get the TextView or Editext from it. And then set error on it. You can get…
Month: July 2019
How to create a csv file in Laravel?
Declare Header Declare Columns Get data Set Formatted data to a variable Return response Your code should look like this
How to send SMTP mail with Attachments in Laravel?
Firstly get the extension of the file to send and get the MIME TYPE for it. Use the mail function and pass the required data needed by the layout and SMTP connection protocol.
How To pass infinite argument in PHP function?
There are many ways to pass undefined no of arguments in a function. Mostly I use one of these three ways:- Pass all the Argument in the form of an array Use func_get_args () to get all the passed argument…
Form Validation And Ajax submission using Jquery Validation
Jquery has a validation plugin which requires “rules:” and “messages:”. Rules are the validation case that you want to check on an input field. And, Messages are the response to those input field which violates the rules. Jquery validation uses…
Regex (Regular expression) To find if the string contains a numeric value.
Sometimes we have to validate if the user has entered a specific pattern or not, this pattern is validated by matching it with its regular expression. To Find if any numeric value appears in a string: To Find if any…
How to EditText accepts alphabets only in Android?
Add this line in your EditText tag in layout(xml) file or you can read more about this here Full code EditText should be look like
Conditional operator problems in JavaScript?
Let me give you a simple logical problem:- What will be the output of console.log(1>0)? If your answer is true than you can proceed to next problem, if your answer is false go visit your Mathematics teacher. Now What will…
What is Anonymous function or Closure in Php?
These are the function with no defined function. Mostly used for callback. These are accessed by the variables on which they are defined or invoked dynamically.
How to use multiple where condition in Laravel?
You can add where clause to a model like ->where(/*condition*/) Sometimes We need to add orWhere condition to our queries, between two cases. This might interfere with other conditions so we need to pass them in a function. To get…