|
-
Aug 4th, 2000, 03:39 PM
#1
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.
-
Aug 4th, 2000, 05:06 PM
#2
Hyperactive Member
I am not too sure
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
-
Aug 6th, 2000, 02:54 PM
#3
Fanatic Member
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>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|