Solved

Dynamically add Spry Form Fields

Posted on 2009-07-02
5
326 Views
Last Modified: 2012-05-07
Hi Experts,

I was hoping someone here might be able to help.  I have created a user registration page using Dreamweaver and the Spry Form Fields.  The form consists of an embedded table with one row, which provides 3 spry text fields and 2 spry select fields.  What I am trying to do is have a button below this table which will insert a new row and create the spry inputs as per the above row.  For example the first column is purely text 'User 1:' and second column has a sprytextfield labeled 'userName1', when the user clicks add user, a new row is inserted first column should read 'User 2:' and the second column should have a sprytextfield labeled 'userName2'.

Along with this function a remove button will need to become visible once a second row is added but removed if the user deletes the second row.

I have uploaded the html page I am working in the hope it makes it a little easier to understand.
requestForm.txt
0
Comment
Question by:john_hollings
  • 3
  • 2
5 Comments
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 24769998
Hi john_hollings,

You can easily do this with the wforms library...

http://www.formassembly.com/wForms/tutorials/limited_repeat.php
0
 
LVL 5

Author Comment

by:john_hollings
ID: 24787175
Hi Jason1178,

I have had a look on the site and it looked very promising however I am failing to workout how this will assist with my issue as I am using Spry inputs that validate the user's responses along with having everything in a table.  Although have done a fair bit in Javascript before I still consider myself a newbie.

Do you have any further suggestions?
0
 
LVL 70

Accepted Solution

by:
Jason C. Levine earned 500 total points
ID: 24787503
I'm suggesting you not use Spry because of the needs of the project.  While it isn't too hard to generate multiple inputs with the Spry coding attached, you need to also add additional javascript calls to handle each input and that's where I see this falling apart.

wforms has an ajax-like validation module and combine it with the replication module you can get the same effect as using Spry without having to worry about how to generate the extra javascript calls for Spry at the end of the HTML file.

If you use Spry elsewhere on your site, you can configure wforms' error routine with custom CSS so that it looks like Spry...
0
 
LVL 5

Author Comment

by:john_hollings
ID: 24789116
OK, I did look at wform validation and thought it look pretty good / close to spry.  Many thanks for confiriming what I thought the best approach was.
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 24789259
You're welcome! Good luck with the project.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Get to know the ins and outs of building a web-based ERP system for your enterprise. Development timeline, technology, and costs outlined.
This video teaches users how to migrate an existing Wordpress website to a new domain.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now