0

Hi,
Not sure if this is right place to post this, please move if needed.
I set up a web form so that the text from a set of text boxes was inserted into a database when you 'submitted' the form
Since then I have added some validation to the boxes using javascript, to make sure the boxes arent empty etc.
However, it no longer inserts the text into the database, below is what the code looks like now, and all I get as a result is nothing, leaves the field seemingly empty. Just the field surname is the input box at the moment, as I have used javascript to check that there is text in there, so they won't submit a form with bits missing
Any ideas?

conUsers = New Data.OleDb.OleDbConnection("provider=microsoft.jet.oledb.4.0;data source = " & Path)


        conUsers.Open()

        Dim cmdstr As String = "INSERT INTO Users (FamilySurname, NumberOfMembersOfFamily, EmailAddress, TelephoneNumber, HomeAddress) "
        cmdstr &= "VALUES ('" & request.getstr("surname") & "','" & txt_NoOfMembers.Text & "','" & txt_Email.Text & "','" & txt_Telephone.Text & "','" & txt_HomeAddress.Text & "') "

        cmdSelect = New Data.OleDb.OleDbCommand(cmdstr, conUsers)

        dtrResults = cmdSelect.ExecuteScalar

        conUsers.Close()

Edited by peter_budo: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks)

1
Contributor
1
Reply
2
Views
7 Years
Discussion Span
Last Post by George.Storm
0

Hello anyone?
Is there a way to do this? Surely I dont have to choose between javascript validation on the boxes and the ability to get the data from the boxes??
They are all html inputboxes as that was the only way I could work out to be able to use javascript on them.

This topic has been dead for over six months. 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.