[thelist] Dynamic form question expansion

Bojan Tesanovic btesanovic at gmail.com
Tue Feb 26 15:26:05 CST 2008


Well you can use either Flash or JS , JS is a great way to do dynamic  
forms, you can do great things with AJAX if you need it,

I would strongly recomend some JS library , and I prefer jquery ,  
google it , it is great lightweight JS lib with good documentation  
examples, and plugins, ah yes plugins... there may be already a plug- 
in for dynamic forms.

here is simple code sample

<form ....>
<div id='frmFileds'>
	Text: <input type='text' name='...1' />  <br/>
	Text2: <input type='text' name='...2' />  <br/>
</div>

</form>
  <a href="#" onclick="js:addInput()">add input</a>


JS code with jQuery

function addInput(){
	//this will add another input field
	$('#frmFileds').append("Text3: <input type='text' name='name3' /><br/ 
 >");
}

hope this can give you and idea ....

On Feb 26, 2008, at 6:48 PM, Gersten, John wrote:

> Can anyone suggest a starting point for switching from static forms  
> to a
> setup where a user can elect to add pre-set questions to a form as
> necessary? We're trying to track user transaction information and a
> given user might need to give info on three transactions, whereas
> another might have 30. We're looking at a javascript approach but are
> becoming worried that in doing so we may be missing a better, more
> elegant solution.
>
> We're on a unix system and the forms currently run through a custom  
> php
> validation scheme and then shoot the validated results through  
> sendmail.
>
> Any guidance/info will be greatly appreciated!
>
> (Long-time lurker as webmaster at lchb.com; just switched the  
> subscription
> this morning to the new address, sorry for any confusion)
> -- 
>
> * * Please support the community that supports you.  * *
> http://evolt.org/help_support_evolt/
>
> For unsubscribe and other options, including the Tip Harvester
> and archives of thelist go to: http://lists.evolt.org
> Workers of the Web, evolt !

Bojan Tesanovic
http://www.carster.us/







More information about the thelist mailing list