Button to validate input

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Basr

    #1

    Button to validate input

    I tried to use this script to validate the input of the form Ford.

    When I use the Input ype Button the script is OK

    I want to use a picture as a button but then the script does not function.
    Can someone help me a little.

    Thanks in advance
    Marcel

    <INPUT TYPE="image" SRC="transport. gif" NAME="Trans" BORDER="0">







    <SCRIPT LANGUAGE=VBScri pt>

    Sub Trans_OnClick()

    'Validate all fields contain data

    If Len(Ford.Nam.va lue)=0 THEN

    Alert "You need to fill out your Name !"

    Ford.Nam.focus

    Exit Sub





    Elseif Len(Ford.Carnr. value)=0 THEN

    Alert "You need to fill out your Carnumber!"

    Ford.Carnr.focu s

    Exit Sub



    End If

    Call Trans.submit()

    End Sub

    </SCRIPT>


  • Basr

    #2
    Re: Button to validate input

    Do not respond, I found a solution!

    "Basr" <mokbck@hetnet. nlschreef in bericht
    news:451e5c85$0 $2023$ba620dc5@ text.nova.plane t.nl...
    I tried to use this script to validate the input of the form Ford.
    >
    When I use the Input ype Button the script is OK
    >
    I want to use a picture as a button but then the script does not function.
    Can someone help me a little.
    >
    Thanks in advance
    Marcel
    >
    <INPUT TYPE="image" SRC="transport. gif" NAME="Trans" BORDER="0">
    >
    >
    >
    >
    >
    >
    >
    <SCRIPT LANGUAGE=VBScri pt>
    >
    Sub Trans_OnClick()
    >
    'Validate all fields contain data
    >
    If Len(Ford.Nam.va lue)=0 THEN
    >
    Alert "You need to fill out your Name !"
    >
    Ford.Nam.focus
    >
    Exit Sub
    >
    >
    >
    >
    >
    Elseif Len(Ford.Carnr. value)=0 THEN
    >
    Alert "You need to fill out your Carnumber!"
    >
    Ford.Carnr.focu s
    >
    Exit Sub
    >
    >
    >
    End If
    >
    Call Trans.submit()
    >
    End Sub
    >
    </SCRIPT>
    >
    >

    Comment

    • Dean Earley

      #3
      Re: Button to validate input

      Basr wrote:
      Do not respond, I found a solution!
      You found a relevant news group?
      VBScript/ASP is VERY different to Visual Basic.

      --
      Dean Earley (dean.earley@ic ode.co.uk)
      i-Catcher Development Team

      iCode Systems

      Comment

      Working...