Click to See Complete Forum and Search --> : I need HTML Help fast, please
I have a submit button on a page and i have 3 text boxes.
i want to make this, when the button is pressed,
text4.value ((text3*3)/text2)
but i donīt know how the code to know when the button is presed and i donīt know id this code above is valid.
i realy need help.
razzaj
Aug 4th, 2000, 05:06 PM
I am only a beginner in Scripting so I believe this must be done this way ...
consider your button name is Btn :
<script>
<!-- Language= VB-script -->
sub Btn_onclick () <--- I am not sure about the paranthesis
text4 =((text3*3)/text2)
end sub
</script>
the Value of your Fourth txtbox must be text4
I think it will work like that ... but I am sure it wont if you are using Netscape ... Netscapee doesnt support Vbscript it only supports Java Script
Psyrus
Aug 6th, 2000, 02:54 PM
Or you can try something like this in JavaScript:
<HTML>
<TITLE>Testing Input</TITLE>
<HEAD>
<SCRIPT language = "JavaScript">
function Calculate()
{
MyForm.Text4.value =((MyForm.Text3.value*3)/MyForm.Text2.value);
}
</SCRIPT>
<BODY>
<FORM name = "MyForm">
<BR>
<input type = "textbox" name = "Text2">
<BR>
<input type = "textbox" name = "Text3">
<BR>
<BR>
<input type = "textbox" name = "Text4">
<BR>
<BR>
<input type = "button" value = "Calculate" onclick = "Calculate()">
<BR>
<BR>
</BODY>
</HTML>
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.