0

How do i call a vb subroutine from a javascript function?

in my code i want to verify if the field is filled or not.if its left black a message pops up but if it is filled it should proceed to submit the form or run the background vb subroutine.

here is my code

<script language="javascript"> 
     function validate() 
        {         
            if (document.getElementById("txtbox").value == "")
                {
                 alert("it works");
                }
            else
               {
                              //call a vb routine here
               }
                 return false;
        }        
</script>

Thank you in advance

Edited by mike_2000_17: Fixed formatting

2
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by gabrielmusa
0

so wots the problem..

create a sub routine function

make that function returns true or false..

call the function in main ...depend on function wot it returns

you can move forward..!

0

check my code please.i already have the vb sub routine but how can i call it from the javascript.

this is the vb subroutine i want to call in the else block

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.