Results 1 to 3 of 3

Thread: I need HTML Help fast, please

  1. #1
    Guest
    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.

  2. #2
    Hyperactive Member razzaj's Avatar
    Join Date
    Oct 1999
    Location
    jounieh
    Posts
    261

    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


    - regards -
    - razzaj -

  3. #3
    Fanatic Member Psyrus's Avatar
    Join Date
    Jul 2000
    Location
    NJ
    Posts
    602
    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>


    Chris

    VB 6.0 Calendar App Video Gamers Group
    Don't forget to rate people if they helped you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width