Hi to all,

I have function (called Cal() ) which is in another function that called when the page is onload.


The problem is the Cal() should call when the button is onclick .
but in the program, it can't work ,
(I attaches file )


Can any body help me !!!!


Thank you.....

if you want Cal to run you must put parentheses at the end of it

<input type="button" onClick="Cal()"> // with parentheses at the end that will work

Thank you ,
I did not know why I deleted () from the calling. I sure that this wrong is in writing quickly .


OK , I corrected the error but still the problem , and re-updated the attachment .

I hope to check it , if you can

Ok from what i see, you are calling a function from a button. The only problem is that the function itself is missing. do something simple like

function Cal() {
    alert("hi");
}

the function itself is missing. do something simple like

Ok, I did this :

function Cal() {
   
      alert("hi");
   
      }

and I deleted the rest sentences , but it don't present the alert message


Thank you ..

post what you have all together.

OK,
This is code after alert message , if you want this

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.