Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET
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 23-Jan-13 2:11am

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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
<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.
<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...
  Permalink  
v4
Comments
Maruthiram_99 at 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
Tadit Dash at 23-Jan-13 7:48am
   
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 at 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
Tadit Dash at 24-Jan-13 1:44am
   
Ok. I have updated the answer. Please check the answer under heading "Scientific Calculator".
 
Thanks...
Tadit Dash at 24-Feb-13 8:04am
   
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)



Advertise | Privacy | Mobile
Web03 | 2.8.141220.1 | Last Updated 24 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100