Results 1 to 5 of 5

Thread: vbscript and forms

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2001
    Posts
    259

    vbscript and forms

    Hi Friends,

    Is this easy and/or possible to do?
    I have a Form with 3 textboxes and 1 button.
    When i submit that form i wish to go to a vbscript function that check the textboxes on a value. If they are not empty the form will be posted to a other asp page, if they are empty i will show a msgbox. I really don't know how to do.I am searching but can't find a solution. Will keep searching but maybee someone here have a quick solution.

    Thanks,
    Matrixxx

  2. #2

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2001
    Posts
    259

    Re: vbscript and forms

    Now i found it!
    Now i am searching how i can delete the value in a textbox when i click on it (focus)

  3. #3
    Fanatic Member
    Join Date
    Aug 2005
    Location
    Up State NY
    Posts
    525

    Re: vbscript and forms

    Could try:
    <code>
    sub Text1_click()
    text1Clear
    end sub


    sub text1Clear()
    text1.text=""
    end sub
    </code>


    Or just call the sub Text1Clear. Using the Focus param will erase the text when you first type in it.

    Good luck

  4. #4
    Frenzied Member usamaalam's Avatar
    Join Date
    Nov 2002
    Location
    Karachi
    Posts
    1,308

    Re: vbscript and forms

    I dont know much about vbscript, but you can also do it with javascript.

    Code:
    <script language="javascript">
    	function Empty()
    	{
    		document.all.txtName.value = "";
    	}
    </script>
    <body>
    <form name="Main">	
    <input type="text" name="txtName" onFocus="javascript:Empty();">
    </form>
    </body>

  5. #5
    Lively Member
    Join Date
    Oct 2004
    Posts
    88

    Re: vbscript and forms

    Quote Originally Posted by Matrixxx
    Now i found it!
    Now i am searching how i can delete the value in a textbox when i click on it (focus)
    <input type="text" name="somename" onClick="this.value=''" onFocus="this.value=''" >

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