 |
|
|
| View previous topic :: View next topic |
| Author |
Message |
veilig
Joined: 14 Apr 2008 Posts: 7
|
Posted: Thu May 29, 2008 3:57 am Post subject: array elements in quickform |
|
|
If I have a form that has the ability to dynamically add elements and I name them as an array
| Code: |
<input type="text" name="answers[]">
|
Is there anyway for QuickForm to handle the rules on these elements? I really only need one rule, required. But I will also need them to be able to be repopulated if the form doesn't pass validation and I don't know how (or if I can) do that because the elements all have the same name.
anyone got any good ideas? |
|
| Back to top |
|
 |
mark

Joined: 07 Jan 2007 Posts: 1053
|
Posted: Thu May 29, 2008 10:35 am Post subject: |
|
|
| I haven't tested it, but wouldn't it help to enumerate the elements? E.g. 'answers[0]', 'answers[1]'. |
|
| Back to top |
|
 |
veilig
Joined: 14 Apr 2008 Posts: 7
|
Posted: Thu May 29, 2008 2:41 pm Post subject: |
|
|
| ahh, that might work. I didn't even think about that. I'll give it a shot and see where it gets me! |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|