Solved

Dynamically add Spry Form Fields

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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

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 …
There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

717 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