0

I have a registration page that needs one final thing and I'm a little stumped...

In one table I have email, pass, gender, dob and the other I have company...

In the registration page, I want to check that the company exists before I submit the form... Since I'm using tools for this and NOT hand coding things, I'm a little lost... Ideally using an AJAX script to check on the orgcode input field would rock...

Here's what I have...

SELECT * from orgcode WHERE orgcode = '" . $orgcode . "'

any coaching would be great!
Ted

3
Contributors
4
Replies
5
Views
8 Years
Discussion Span
Last Post by changeco
0

Does Table1 (email, pass, gender, dob) have a foreign key constraint on CompanyTable? If so, let the database handle the foreign key validation and have the web application check for errors.

Insert failures due to foreign key problems (ie: non-existant CompanyId) will have a specific error number stating a foreign key problem.

0

I'm using tools because I have NO idea where to start on something like this on my own...

I have no idea what a foreign key is, nor how to make one... I assume its a connector for the tables, the short answer is no, I don't have a foreign key constraint... Sorry for my n00b stupidity...

0

Since I'm using tools for this and NOT hand coding things, I'm a little lost... Ideally using an AJAX script to check on the orgcode input field would rock...

I don't know what exactly you mean by tools. But check this example.
In the example, there is a dropdown list, but you have a text field. You can use onblur event (or onkeyup event) to call the ajax function to check if the value entered in the text field is already there in the database.

0

by tools I mean the company I work for uses webassist dreamweaver tools... so you can quickly build dynamic stuff with minimal development knowledge, which is EXACTLY where I am... I am learning but some of the required elements are WAY above my head..

Thanks nav33n for your help...

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.