Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

HTML forms

Guest
Oct 10, 2007 Oct 10, 2007
I'm building forms in HTML that are processed in PHP for storage in a MySQL database - every thing works fine. But now I need a form where for example a field called NAME is used several times. Now I don't want to just simply repeat the field and rename it. I want to use it one then have a button saying ADD ANOTHER. I know partly how to do it, ie have a table and sub table, with the ADD ANOTHERS appearing in the sub table as new records. But how do I go about the form? any body know of a good tutorial on this?
TOPICS
Server side applications
336
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 10, 2007 Oct 10, 2007
You cannot have multiple instances of the same fieldname in a single form.
You would have to figure out some way to dynamically rename the new field as
it's added - perhaps javascript?

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
==================


"seamanager" <webforumsuser@macromedia.com> wrote in message
news:feiero$khk$1@forums.macromedia.com...
> I'm building forms in HTML that are processed in PHP for storage in a
> MySQL
> database - every thing works fine. But now I need a form where for example
> a
> field called NAME is used several times. Now I don't want to just simply
> repeat
> the field and rename it. I want to use it one then have a button saying
> ADD
> ANOTHER. I know partly how to do it, ie have a table and sub table, with
> the
> ADD ANOTHERS appearing in the sub table as new records. But how do I go
> about
> the form? any body know of a good tutorial on this?
>

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 10, 2007 Oct 10, 2007
I've made a free extension which does, I think, what you want:
http://www.kaosweaver.com/extensions/details.php?id=74

Paul Davis
http://www.kaosweaver.com/
Visit us for dozens of useful Dreamweaver Extensions.

http://www.communitymx.com/
Partner at Community MX - Extend your knowledge

seamanager wrote:
> I'm building forms in HTML that are processed in PHP for storage in a MySQL
> database - every thing works fine. But now I need a form where for example a
> field called NAME is used several times. Now I don't want to just simply repeat
> the field and rename it. I want to use it one then have a button saying ADD
> ANOTHER. I know partly how to do it, ie have a table and sub table, with the
> ADD ANOTHERS appearing in the sub table as new records. But how do I go about
> the form? any body know of a good tutorial on this?
>
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 10, 2007 Oct 10, 2007
LATEST
seamanager wrote:
> I'm building forms in HTML that are processed in PHP for storage in a MySQL
> database - every thing works fine. But now I need a form where for example a
> field called NAME is used several times.

If you are using the Dreamweaver Insert Record server behavior, you
can't do this, because Dreamweaver uses the original PHP MySQL
extension, which can handle only one query at a time. If your purpose is
simply to add another record after inserting the first, the easiest way
to handle this is to leave the After inserting, go to field in the
server behavior dialog box blank. This inserts the record, and
redisplays the form ready for another record to be inserted.

The alternative would be to use DOM manipulation to display new form
fields, and then hand-code the PHP logic to build a multiple insert
query. It's not particularly difficult, but I don't know of any online
tutorials, and it involves quite a lot of coding.

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines