Last active
October 22, 2022 18:06
-
-
Save msulaimanmisri/14b160bbb68b8f59abda78938c96041f to your computer and use it in GitHub Desktop.
When Laravel validation appear, Laravel Old Helper will not selected by default. We can use JavaScript to make it happen.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @author Muhamad Sulaiman Misri | |
*/ | |
const oldValueOfYourSelector = '{{ old('selector') }}'; | |
if (oldValueOfYourSelector !== '') { | |
$('selector').val(oldValueOfYourSelector); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment