simple javascript not working?!?!?

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default simple javascript not working?!?!?

    why doesn't PrintGrid() get called at Print Button OnClick???!??!!

    -------------------- Code in aspx file

    .....initial stuff
    <HEAD>
    .... title and meta stuff
    <SCRIPT LANGUAGE="javascript">

    function GetDate(CtrlName)
    {
    // this method gets called??!!
    ....method code
    }

    function CheckWindow()
    {
    // linked into the onload body...
    ....method code
    }

    function PrintGrid()
    {
    alert([about to print]); // this doesn't get processed!!! Here
    so i knon when it does
    parent.overview.focus();
    window.print();
    alert([printed]);
    }

    </SCRIPT>
    </HEAD>

    <BODY onunload="CheckWindow();" MS_POSITIONING="GridLayout">

    .... other HTML ...

    <!-- this works and calls method above... -->
    <A HREF="javascript:GetDate('txtEndDate');"><img id=btnToDate
    src="images\SmallCalendar.gif" BORDER=0></A>

    <!-- this doesn't even called the function?!?!? -->
    <BUTTON TYPE="button"
    ONCLICK="javascript:PrintGrid();"><b>Print</B></BUTTON>

    .... more HTML and closing ...


    Daniel Bass Guest

  2. Similar Questions and Discussions

    1. Output a query into simple Javascript
      Hi I have a query the results of which I'd like to use in Javascript to form the items in a dynamic menu.... eg i run query with results.....
    2. Simple Javascript question
      Hi This works the first time I click the button but wont work after that - not sure why, aim is to make it a toggle really function...
    3. concatenate in Javascript? simple field validation funciton notworking
      function validatePhoneNumber(v) { with(v.form){ stripped=v.value.replace(//g, ''); ........ v.focus(); } } <input type="text"...
    4. Simple menu in javascript
      I have a list on my page. E.G Users : Applications When the user clicks on 1 of them for example "users" I want this to appear : Users :...
    5. Simple JavaScript question...
      What's the command to make something happen as soon as a page is loaded? Thanks! CS
  3. #2

    Default Re: simple javascript not working?!?!?

    worked, thanks James! I thought alert syntax was : (?)

    alert([message]);

    new to javascript and nots me favourite.


    Daniel Bass Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139