Click here to Skip to main content
15,887,349 members
Home / Discussions / JavaScript
   

JavaScript

 
Questioncss class not working Pin
Member 110313047-May-17 21:45
Member 110313047-May-17 21:45 
AnswerRe: css class not working Pin
Afzaal Ahmad Zeeshan7-May-17 23:20
professionalAfzaal Ahmad Zeeshan7-May-17 23:20 
Questionhow to call the same component more than one time Pin
Member 110313046-May-17 10:55
Member 110313046-May-17 10:55 
QuestionJquery touchend touchcancel doesn't fire Pin
jkirkerx21-Apr-17 6:55
professionaljkirkerx21-Apr-17 6:55 
AnswerHad the wrong viewport setting in zoomEnable, but I don't understand why I can't stop touchend from firing after touchstart Pin
jkirkerx21-Apr-17 7:44
professionaljkirkerx21-Apr-17 7:44 
AnswerI don't get it Pin
jkirkerx21-Apr-17 11:44
professionaljkirkerx21-Apr-17 11:44 
AnswerRe: Jquery touchend touchcancel doesn't fire [got it now] Pin
jkirkerx27-Apr-17 10:30
professionaljkirkerx27-Apr-17 10:30 
QuestionHow do I ensure that checkbox is validated FIRST before showprogress? Pin
samflex20-Apr-17 9:23
samflex20-Apr-17 9:23 
Greetings again.

We have a couple of situations where we want our users to check a box before their order is submitted.

So far, when I click the submit button, checkbox validation is ignored.

Any ideas how to make this work?

PHP
    <script type="text/javascript">
        function ValidateCheckBox(sender, args) {
            if (document.getElementById("<%=chkTerms.ClientID%>").checked == true) {
                args.IsValid = true;
            } else {
                args.IsValid = false;
            }
        }
        function ShowProgress() {
            setTimeout(function () {
                var modal = $('<div />');
                modal.addClass("modal");
                $('body').append(modal);
                var loading = $(".loading");
                loading.show();
                var top = Math.max($(window).height() / 2 - loading[0].offsetHeight / 2, 0);
                var left = Math.max($(window).width() / 2 - loading[0].offsetWidth / 2, 0);
                loading.css({ top: top, left: left });
            }, 200);
        }
        $('form').on("submit", function () {
            ShowProgress();
        });
    </script>

//checkbox
  <asp:CheckBox ID="chkTerms" runat="server" />
 <asp:CustomValidator ID="CustomValidator1" runat="server" ErrorMessage="Check the box before you can submit your data" ClientValidationFunction = "ValidateCheckBox"></asp:CustomValidator><br /> 

//submit button
<asp:Button ID="btnSave" runat="server" Text=" Submit " OnClick="btnSave_Click" />

AnswerRe: How do I ensure that checkbox is validated FIRST before showprogress? Pin
Richard Deeming24-Apr-17 9:21
mveRichard Deeming24-Apr-17 9:21 
GeneralRe: How do I ensure that checkbox is validated FIRST before showprogress? (SOLVED) Pin
samflex2-May-17 8:40
samflex2-May-17 8:40 
QuestionCapture the browser close event from the close button on top left corner Pin
Zeyad Jalil15-Apr-17 1:35
professionalZeyad Jalil15-Apr-17 1:35 
AnswerRe: Capture the browser close event from the close button on top left corner Pin
Afzaal Ahmad Zeeshan15-Apr-17 3:01
professionalAfzaal Ahmad Zeeshan15-Apr-17 3:01 
AnswerRe: Capture the browser close event from the close button on top left corner Pin
F-ES Sitecore18-Apr-17 1:10
professionalF-ES Sitecore18-Apr-17 1:10 
GeneralRe: Capture the browser close event from the close button on top left corner Pin
ZurdoDev18-Apr-17 2:04
professionalZurdoDev18-Apr-17 2:04 
GeneralRe: Capture the browser close event from the close button on top left corner Pin
F-ES Sitecore18-Apr-17 2:38
professionalF-ES Sitecore18-Apr-17 2:38 
GeneralRe: Capture the browser close event from the close button on top left corner Pin
ZurdoDev18-Apr-17 3:03
professionalZurdoDev18-Apr-17 3:03 
QuestionHow to get Dynamic XFA form data using javascript Pin
abc123aaaa12-Apr-17 20:55
abc123aaaa12-Apr-17 20:55 
QuestionCenter a mouse over pop up one the page Pin
Member 131137407-Apr-17 9:56
Member 131137407-Apr-17 9:56 
AnswerRe: Center a mouse over pop up one the page Pin
Afzaal Ahmad Zeeshan7-Apr-17 12:07
professionalAfzaal Ahmad Zeeshan7-Apr-17 12:07 
GeneralRe: Center a mouse over pop up one the page Pin
Member 131137407-Apr-17 12:22
Member 131137407-Apr-17 12:22 
GeneralRe: Center a mouse over pop up one the page Pin
Afzaal Ahmad Zeeshan7-Apr-17 12:35
professionalAfzaal Ahmad Zeeshan7-Apr-17 12:35 
GeneralRe: Center a mouse over pop up one the page Pin
Member 131137407-Apr-17 18:32
Member 131137407-Apr-17 18:32 
QuestionCenter a mouse over popup Pin
Member 131137407-Apr-17 9:56
Member 131137407-Apr-17 9:56 
AnswerRe: Center a mouse over popup Pin
Afzaal Ahmad Zeeshan7-Apr-17 12:09
professionalAfzaal Ahmad Zeeshan7-Apr-17 12:09 
QuestionRent Distribution using javascript Pin
Member 131075305-Apr-17 0:52
Member 131075305-Apr-17 0:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.