![]() |
|
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Newbie
|
simple multiply script
Hi all our teacher gave us this simple script that when someone gives two numbers in two forms then it will multiply their contents and print the result in an another form after he click one button.Here is the code:
<script language="javascript">
function convert (form)
{
if ((form.first.value == "")
(form.second.value ==""))
return;
form.result.value=form.first.value * form.second.value;
}
</script><form method="post"> Give first number:<input type="text" name="first" value=0 onchange=convert(this.form)> <p>Give second number:<input type="text" name="second" value=0 onchange=convert(this.form)> <p><input type="button" name="calculate" value="calculate" onclick=convert(this.form)> <p>Result:<input type="text" name="result" value="not calculated" ><br> </form> |
|
|
|
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Simple blackjack script problem. Need help. | jokr004 | C++ | 6 | Feb 10th, 2006 11:44 AM |
| A simple script isn't working correctly | scuzzman | Perl | 3 | Dec 23rd, 2005 6:42 AM |
| A simple perl script | satimis | Perl | 3 | Aug 15th, 2005 9:31 AM |
| A simple script to execute a command package | satimis | Bash / Shell Scripting | 3 | Aug 12th, 2005 11:28 PM |
| Simple menu script | trufla | Bash / Shell Scripting | 2 | Apr 4th, 2005 10:17 AM |