Welcome :Guest

Congratulations!!!

Top 5 Contributors of the Month
sritaa
Sandeep Singh
Melody Anderson
Eminent IT

 Home >> Code Snippets >> Javascript >> Post New Resource

# Arithmetic Operators with Validation

Posted By:NATHAN ISRAEL       Posted Date: October 04, 2011    Points: 40    Category: Javascript    URL: http://www.dotnetspark.com

Arithmetic Operators with Validation(vbscript)

```
ARITHMETIC OPERATIIONS

a=myform.nameone.value
if a="" then
msgbox "Please Enter The First Value",16,"Enter First Value"
end if
b=myform.nametwo.value
if b="" then
msgbox "Please Enter The Second Value",16,"Enter Second Value"
end if
myform.namethree.value=clng(a)+clng(b)

end sub

sub sub_onclick
a=myform.nameone.value
if a="" then
msgbox "Please Enter The First Value",16,"Enter First Value"
end if
b=myform.nametwo.value
if b="" then
msgbox "Please Enter The Second Value",16,"Enter Second Value"
end if
myform.namethree.value=clng(a)-clng(b)

end sub

sub mul_onclick
a=myform.nameone.value
if a="" then
msgbox "Please Enter The First Value",16,"Enter First Value"
end if
b=myform.nametwo.value
if b="" then
msgbox "Please Enter The Second Value",16,"Enter Second Value"
end if
myform.namethree.value=clng(a)*clng(b)

end sub

sub div_onclick
a=myform.nameone.value
if a="" then
msgbox "Please Enter The First Value",16,"Enter First Value"
end if
b=myform.nametwo.value
if b="" then
msgbox "Please Enter The Second Value",16,"Enter Second Value"
end if
myform.namethree.value=clng(a)/clng(b)

end sub

ARITHMETIC OPERATIIONS

ENTER FIRST NUMBER

ENTER SECOND NUMBER

RESULT

```

Responses

No response found. Be the first to respond this post

Post Comment