Solved

Dynamically add Spry Form Fields

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

Major Incident Management Communications

Major incidents and IT service outages cost companies millions. Often the solution to minimizing damage is automated communication. Find out more in our Major Incident Management Communications infographic.

Question has a verified solution.

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

Suggested Solutions

When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
This article discusses how to implement server side field validation and display customized error messages to the client.
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

732 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