Dear Sir,
Please help me.
How to enter input text value in sweet alert and display in textbox in asp.net.
I want to check the length of remark.
Thnaks
Arvind
Hi arvindasp,
Refer below sample.
HTML
<input name="txtRemark" type="text" id="txtRemark" /> <input type="submit" name="btnValidate" value="Validate" id="btnValidate" /> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.0/sweetalert.min.js"></script> <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.0/sweetalert.min.css" /> <script type="text/javascript"> $(function () { $('[id*=btnValidate]').on('click', function () { if ($('[id*=txtRemark]').val().length == 0) { swal('', 'Enter Remark', 'error'); return false; } }); }); </script>
Demo
© COPYRIGHT 2025 ASPSnippets.com ALL RIGHTS RESERVED.