Connecting Tech Pros Worldwide Help | Site Map

Selection forms

  #1  
Old May 10th, 2006, 07:15 PM
guitarromantic@gmail.com
Guest
 
Posts: n/a
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, 08:45 PM
tim
Guest
 
Posts: n/a

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, 08:45 PM
guitarromantic@gmail.com
Guest
 
Posts: n/a

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, 08:55 PM
David Dorward
Guest
 
Posts: n/a

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, 09:55 PM
guitarromantic@gmail.com
Guest
 
Posts: n/a

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!

Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Test Driven Development with Windows Forms Tim Haughton answers 0 November 22nd, 2005 11:44 PM
Test Driven Development with Windows Forms Tim Haughton answers 0 November 17th, 2005 12:56 PM
Test Driven Development with Windows Forms Tim Haughton answers 0 November 11th, 2005 01:35 PM
how to test for browser specific methods like document.selection.createRange lawrence answers 15 July 23rd, 2005 04:46 PM