JavaScript confirm cancel button still posting

Cancel button on the confirm dialog still causing post back and calling server side button event. <asp:Button ID="btnSubmit" runat="server" CssClass="CommandButton" Width="110px" OnClientClick="confirmPayment();" UseSubmitBehavior="false" Text="Submit Payment" OnClick="btnSubmit_Click"></asp:Button> function confirmPayment() { var isOkay = confirm("Confirm Payment?"); if (isOkay) { return true; } else { return false; } } I tried to debug my code and i can … Read more

Regular Expression Validation in asp.net displaying the error message even when the phone number is correct

function regex() { var regex = new RegExp(/^(009665|9665|+9665|05|5)(5|0|3|6|4|9|1|8|7)([0-9]{7})$/); regex.test(‘0501234567’); // return true; regex.test(‘0521234567’); // return false; } regex() <div class=”newAcc”> <asp:TextBox ID=”phone” runat=”server” CssClass=”phone” value=”+966″ placeholder=”+966″></asp:TextBox> <asp:RegularExpressionValidator ID=”RegularExpressionValidator1″ runat=”server” ErrorMessage=”يرجى كتابة رقم هاتف صحيح” CssClass=”errorMassege” ControlToValidate=”phone” ForeColor=”#CC1007″ ValidationExpression=”/^(009665|9665|+9665|05|5)(5|0|3|6|4|9|1|8|7)([0-9]{7})$/” display=”Dynamic”></asp:RegularExpressionValidator> </div> the regex is working correct and the massage error displays even if the phone number … Read more

Cannot retrieve ASP.Net Textbox value in JavaScript function

I’ve got an ASP.Net TextBox that I want to pass it’s text value to a JavaScript function. I’ve tried several different methods, including the one at this answer, Getting Textbox value in Javascript but my value is always returned as undefined. These textboxes are part of an <asp:UpdatePanel> but I have tried this outside of the panel, and receive the same error.

convert varchar to month year format in sql server or javascript

I have a ”varchar” like ‘2020-08’ in ”sql” table. I need to convert it like ‘Aug 2020’ to show it in my web page. select convert(varchar,’2020-08′,107) This does not seem to work. Answers: Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue … Read more