Solved

Dynamically add Spry Form Fields

Posted on 2009-07-02
5
329 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

821 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