Skip to main content
June 2, 2009
Question

Form validation during database Record Update (dreamweaver/php/sql)

  • June 2, 2009
  • 2 replies
  • 1452 views

I  am using the Dreamweaver Update Record Wizard to update my database records.  Basically, Dreamwevar creates for you an update form and then writes it to the database when you click the submit button on the form. 

I edited the update form to include onsubmit="return MyValidateFields(this);"  to validate my fields before writing them to the database. MyValidateFields() is just a JavaScript function I wrote to validate fields such as password, username, etc.  This method works very well with the Insert Record behavior,  but I am not getting it to work with the Update Record Behavior.  It looks as though when the submit button is clicked the MyValidateFields function is not even invoked. Am I doing something wrong, or is it because this onsubmit feature can not be used with the Update Record behavior? Any ideas?

This topic has been closed for replies.

2 replies

June 25, 2009

I am closing this as the problem has disaapeared.

DwFAQ
Participating Frequently
June 2, 2009

Your form validation will not work for anyone that has javascript disabled.

June 2, 2009

Thanks for the answer.  What method then (other than JavaScript validation) which will  never be disabled can  I use?

Also do you have an answer to my first question?  Thanks.

DwFAQ
Participating Frequently
June 2, 2009

You should use server side validation such as php, asp, coldfusion, etc. where the data is validated on the server side. You can combine js and server side validation so users with js enabled will validate the form on client side without page reload and server side validation is used if javascript is disabled.

On regard to your first question I can't see your code so I can't speculate as to what your issue is besides the speculations you've already presented.