Results 1 to 4 of 4

Thread: Checking for validation?

  1. #1

    Thread Starter
    Member
    Join Date
    Apr 2000
    Posts
    35

    Question

    Hello.
    I am making a program to help people with HTML. I.e. They fill out areas such as (combo boxes for background, text, link colors, etc. Text boxes for their email address, etc.)
    What I needed to know how to do was the following:

    1. Check to make sure all fields have been filled out, if not. alert the user with a MsgBox telling them which was missed.
    2. If ALL fields are filled out the program may proceed and fill in the Text box with the HTML, using the supplied information, but have it so it will not go on without having them all filled in.

    (during coding)
    3. How (when using a Rich Text Box, to go to the next line down [as if you had hit the enter key]...rather than have to put a million spaces till it pushes the text to the line beneath the previous one.

    Thanks in advance to anyone who can help me out a little

    (if it helps i have 1 textbox for email, 3 rich text boxes, 5 combo boxes for colors and a command button used to check all that and enable a rich text box to place the html codes there)
    "..Follow the white rabbit.."

  2. #2
    Fanatic Member Dim's Avatar
    Join Date
    Jul 2000
    Posts
    620
    1.
    [CODE]
    If TExt1.Text = "" Or Text2.TExt = "" Or Combo1.Text = "" Then
    MsgBox "Not all fields are fillled in", vbOkONLY, "Error"
    Exit Sub
    End If
    [CODE]
    2.
    Code:
    html.text = Text1.TExt & TExt2.TExt & Combo1.Text
    3.
    Code:
    RichTextBox1.Text = RichTextBox1.Text & vbCrLf
    'vbCrLF will start a new line
    Hope that helps,
    D!m
    Dim

  3. #3
    Frenzied Member Jop's Avatar
    Join Date
    Mar 2000
    Location
    Amsterdam, the Netherlands
    Posts
    1,986
    Answer to 1 & 2:

    Code:
    'Put the TxtBoxes in an array
    
    Private Function CheckAllBoxes()
    For x = 0 To NROFTEXTBOXES
    If txtHTML(x).Text = "" Then
    MsgBox "Please fill in all textboxes!!!"
    Exit Function
    End If
    Next x
    
    'Fill the HTML here!
    End Function
    Answer to 3
    Code:
    Rtf1.text = rtf1.text & VbCrLf
    Hope it helped!

    Hey DIM you beat me


    [Edited by Jop on 09-08-2000 at 02:56 PM]
    Jop - validweb.nl

    Alcohol doesn't solve any problems, but then again, neither does milk.

  4. #4

    Thread Starter
    Member
    Join Date
    Apr 2000
    Posts
    35

    Talking

    That works perfect! Thanx!
    "..Follow the white rabbit.."

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