Click here to Skip to main content
12,633,764 members (32,799 online)
Rate this:
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
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.

<FORM NAME="Calc">
<INPUT TYPE="text"   NAME="Input" Size="16">
<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 += ' + '">
<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 += ' - '">
<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 += ' * '">
<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 += ' / '">

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="'','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>

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
Tadit Dash 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 24-Jan-13 1:12am
Thanks I got ur answer....but can u give me code for scientific could be very useful if u provide tat....plzz
Tadit Dash 24-Jan-13 1:44am
Ok. I have updated the answer. Please check the answer under heading "Scientific Calculator".

Tadit Dash 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.


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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.161208.2 | Last Updated 24 Jan 2013
Copyright © CodeProject, 1999-2016
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