?
Solved

Dynamically add Spry Form Fields

Posted on 2009-07-02
5
Medium Priority
?
333 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 1500 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When the s#!t hits the fan, you don’t have time to look up who’s on call, draft emails, call collaborators, or send text messages. An instant chat window is definitely the way to go, especially one like HipChat. HipChat is a true business app. An…
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

764 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