close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Validate enum field

Thread began 9/12/2013 10:48 am by paulshoe379536 | Last modified 9/12/2013 12:19 pm by paulshoe379536 | 1958 views | 4 replies |

paulshoe379536

Validate enum field

I am creating a login page. I have three fields to validate, "username", "password" and "active". My "active" field is designated as enum and I need to validate that it contains 'y'. I set "active" as a hidden input in the form. The visitor logging will not enter this value. When the Authenticate User wizard finishes, the value for the enum column type = $WA_Auth_Separator."" (or blank)

When I try to use the login, I get a error message that states "Unknown column 'y' in 'where clause". If I change the column type to "text", I do not get the error, but it doesn't validate the field.

How do I validate an enum field?
I have attached the page code.

Attached Files
index.php
Sign in to reply to this post

Jason ByrnesWebAssist

Since you want the value on registration to be y, you should set the default value for that column to y in the database, then don't include it in the registration at all, it will always be y if no value is passed.

Sign in to reply to this post

paulshoe379536

I'm sorry, I don't think I explained myself properly. This is not a registration but a login. When the user logs in, if their "active" field does not contain 'y', the login should fail.

Sign in to reply to this post

Jason ByrnesWebAssist

you wont be able to do that through a hidden field, you cant populate the login form with the users details before they have logged in.

instead, you should edit the authenticate user sever behavior, on the session tab, set the active column to save to a session on login.

then create an access rule based on the active session;

allow if: session active = y

Sign in to reply to this post

paulshoe379536

thank you Jason, your help is always appreciated...I will use a session value... I was just hoping I could validate all three at the same time...

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...