Connecting Tech Pros Worldwide Help | Site Map

Selection forms

 
LinkBack Thread Tools Search this Thread
  #1  
Old May 10th, 2006, 06:15 PM
guitarromantic@gmail.com
Guest
 
Posts: n/a
Default Selection forms

Hey everyone,

I maintain a music review site and have a php form to submit data to
our database. I have a dropdown form box with all our writers on
(selected from the database) and the selected value is stored in the
database for each review.. straightforward.

However, we also do multi-author reviews. I normally just use the
"Multiple" profile, but this then means in lists of reviews by authors,
their multiple ones don't show up. I could hack a way around this but
frankly it'd be better for the site if I could associate a review with
multiple authors. I figure I can do this, so I need a way of making an
appropriate form.

Basically, I want to have two form fields: the aforementioned select
field with a list of all staff, with a "Add" button next to it, which
then adds that user's ID to a second field marked "reviewers", followed
by a comma. I'm evidently no javascript scholar, so can anyone point me
in the right direction?

Matt


  #2  
Old May 10th, 2006, 07:45 PM
tim
Guest
 
Posts: n/a
Default Re: Selection forms


guitarromantic@gmail.com wrote:[color=blue]
> Hey everyone,
>
> I maintain a music review site and have a php form to submit data to
> our database. I have a dropdown form box with all our writers on
> (selected from the database) and the selected value is stored in the
> database for each review.. straightforward.
>
> However, we also do multi-author reviews. I normally just use the
> "Multiple" profile, but this then means in lists of reviews by authors,
> their multiple ones don't show up. I could hack a way around this but
> frankly it'd be better for the site if I could associate a review with
> multiple authors. I figure I can do this, so I need a way of making an
> appropriate form.
>
> Basically, I want to have two form fields: the aforementioned select
> field with a list of all staff, with a "Add" button next to it, which
> then adds that user's ID to a second field marked "reviewers", followed
> by a comma. I'm evidently no javascript scholar, so can anyone point me
> in the right direction?
>
> Matt[/color]

Hi Matt

Have you considered using a multiple select box instead of using
javascript?

Tim

  #3  
Old May 10th, 2006, 07:45 PM
guitarromantic@gmail.com
Guest
 
Posts: n/a
Default Re: Selection forms

That never occured to me! Would I still be able to store values in the
format "1,2,3" though using that method? I plan to then explode these
values at the comma into an array in my database stuff so I can display
each individual author's details.

  #4  
Old May 10th, 2006, 07:55 PM
David Dorward
Guest
 
Posts: n/a
Default Re: Selection forms

guitarromantic@gmail.com wrote:
[color=blue]
> That never occured to me![/color]

What didn't?

http://cfaj.freeshell.org/google/
[color=blue]
> Would I still be able to store values in the format "1,2,3" though using
> that method?[/color]

Once the data gets to your server you can store it in whatever way you like,
although using a database table that has two columns (author table id,
article table id) is the more usual way to do it (and makes it easy to look
things up from either direction).

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
  #5  
Old May 10th, 2006, 08:55 PM
guitarromantic@gmail.com
Guest
 
Posts: n/a
Default Re: Selection forms

David Dorward wrote:
[color=blue]
> What didn't?
>
> http://cfaj.freeshell.org/google/[/color]

Sorry - I wish Google would default to quoting when replying.
[color=blue]
> Once the data gets to your server you can store it in whatever way you like,
> although using a database table that has two columns (author table id,
> article table id) is the more usual way to do it (and makes it easy to look
> things up from either direction).[/color]

This is how I have it setup now, it's a little tricky to explain. I've
been playing around, looks like this is the wrong group really, I need
to get php/mysql to store an array of my selected author_ids from the
list - thanks for the tips though!

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.