Click here to Skip to main content
15,999,303 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to create a application so that on clicking a menu named calculator on master page,a calculator popup should be opened...can any one help?
Posted

1 solution

You can go for the simple Cut & Paste JavaScript calculator[^] and show this control on a popup.

But if you want windows controls then check the below articles.
1. C# Popup Calculator, Button, and Text Control[^].
2. A Calculator Control Box[^].

You can also go through these codes and understand the logic and create this for your webpage.

Or else go for that simple JavaScript Calculator.

Code
XML
<FORM NAME="Calc">
<TABLE BORDER=4>
<TR>
<TD>
<INPUT TYPE="text"   NAME="Input" Size="16">
<br>
</TD>
</TR>
<TR>
<TD>
<INPUT TYPE="button" NAME="one"   VALUE="  1  " OnClick="Calc.Input.value += '1'">
<INPUT TYPE="button" NAME="two"   VALUE="  2  " OnCLick="Calc.Input.value += '2'">
<INPUT TYPE="button" NAME="three" VALUE="  3  " OnClick="Calc.Input.value += '3'">
<INPUT TYPE="button" NAME="plus"  VALUE="  +  " OnClick="Calc.Input.value += ' + '">
<br>
<INPUT TYPE="button" NAME="four"  VALUE="  4  " OnClick="Calc.Input.value += '4'">
<INPUT TYPE="button" NAME="five"  VALUE="  5  " OnCLick="Calc.Input.value += '5'">
<INPUT TYPE="button" NAME="six"   VALUE="  6  " OnClick="Calc.Input.value += '6'">
<INPUT TYPE="button" NAME="minus" VALUE="  -  " OnClick="Calc.Input.value += ' - '">
<br>
<INPUT TYPE="button" NAME="seven" VALUE="  7  " OnClick="Calc.Input.value += '7'">
<INPUT TYPE="button" NAME="eight" VALUE="  8  " OnCLick="Calc.Input.value += '8'">
<INPUT TYPE="button" NAME="nine"  VALUE="  9  " OnClick="Calc.Input.value += '9'">
<INPUT TYPE="button" NAME="times" VALUE="  x  " OnClick="Calc.Input.value += ' * '">
<br>
<INPUT TYPE="button" NAME="clear" VALUE="  c  " OnClick="Calc.Input.value = ''">
<INPUT TYPE="button" NAME="zero"  VALUE="  0  " OnClick="Calc.Input.value += '0'">
<INPUT TYPE="button" NAME="DoIt"  VALUE="  =  " OnClick="Calc.Input.value = eval(Calc.Input.value)">
<INPUT TYPE="button" NAME="div"   VALUE="  /  " OnClick="Calc.Input.value += ' / '">
<br>
</TD>
</TR>
</TABLE>
</FORM>


Scientific Calculator
1. Cut & Paste Scientific Calculator[^].

2. Popup Calculator[^]. You can also find the code to popup this one from your web page.
That is like below.
XML
<form><input type="button" value="Popup Calculator" onclick="javascript:window.open('http://ostermiller.org/calc/calculator.html','calculator'+new Date().getTime(),'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=450,height=300');"></form>


Thanks...
 
Share this answer
 
v4
Comments
Maruthiram_99 23-Jan-13 7:31am    
You have provided some cut and paste javascript in that no javascript is available. Cut & Paste JavaScript calculator[^]..only aspx is available..can u give me details of this..this is quite easy for me
Actually that calculator is created through the HTML table and buttons.
just show this table in popup, that's all.
I have updated my answer, where you can find that code.
Maruthiram_99 24-Jan-13 1:12am    
Thanks I got ur answer....but can u give me code for scientific calculaotr...it could be very useful if u provide tat....plzz
Ok. I have updated the answer. Please check the answer under heading "Scientific Calculator".

Thanks...
Hey Maruthiram_99,

Have you checked the answer under heading "Scientific Calculator" ?
Please have a look and implement.

Please accept this answer, if it has helped you in any way.
You will also be awarded with some points and it will be easier for others to find the answer in one go.

Thanks,
Tadit

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900