Sorry its a lame title. Not sure really if this should be hear or over in the sql section. I know what I want to do but I'm blanking on how exactly to go about it. I'm inserting book titles into a library database and what I'd like it to do is search to make sure the author isn't all ready in the author table, if it isn't found it should pop up and ask if they want to create a bio for the author. If they click yes a text area would appear upon hitting okay the author name and bio would be inserted into the author table. If they click no at the bio prompt it should insert the author name and null for the bio.

$aSearch="select aname from authors where aname = '$author'";
	$aSearchResult=@mysql_query($aSearch) or die(@mysql_error());
	if($aSearchResult != $author){
//pseudo code
		pop up message "do you want to enter bio"
                    $bio = text from text area
                    insert into author (aname, abio) values ('$author', $'bio);
                    insert into author (aname, abio) values ('$author', 'NULL);
6 Years
Discussion Span
Last Post by diafol

For a popup, you'll need JS. I've used jQueryUI in a number of projects and found it really simple. The 'multiple' forms can be held in the same dialog. Use js to change the content depending on the button click. This could be as simple as having 3 forms in the popup dialog div. Show the first and hide the rest with CSS classes (or jQuery). Then on button click show/hide the appropriate contents.

However, the dialogs may differ in size. You could always have a number of individual dialogs.


looks like I'll have to refresh myself on javascript. I've never used JQuery but I'll give it a look see.

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.