Hi.

I've implemented a simple "add new user" button to my "amend users"
page. The user list is only about 20 people, with
name/email/pin/contracts/delete options.

The button calls a template evaluation and that is within an update ...

$('vsNewUsers').update($('vsNewUsers').innerHTML +
tmpl_NewUser.evaluate({NewUserID : --i_NewUserID}));

All working fine.

I like how it works, but I wonder how I can just append the result of
the evaluation.

How do I take a template and append the results to vsNewUsers.
vsNewUsers is a tbody element and the template is a <tr> element with
all the <td>'s needed.

var tmpl_NewUser = new Template('<tr><td><input type="text"
name="User[#{NewUserID}][Username]" value="" maxlength="200" size="50"
/></td><td><input type="text" name="User[#{NewUserID}][Email]"
value="" maxlength="200" size="50" /></td><td><input type="number"
name="User[#{NewUserID}][PIN]" value="" maxlength="4"
/></td><td><input class="vsaAllContracts" type="checkbox"
name="User[#{NewUserID}][AllContracts]" value="1"
id="allContracts_#{NewUserID}" /></td><td><input type="text"
name="User[#{NewUserID}][ContactIDs]" value="" maxlength="200"
disabled="disabled" size="50" /><input type="hidden"
name="User[#{NewUserID}][ContactIDs]" value=""></td><td><button
class="vsaChooseContracts bold"
id="selectContracts_#{NewUserID}">Select
contracts</button></td><td><input type="checkbox"
name="User[#{NewUserID}][Delete]" value="#{NewUserID}" /></td></tr>');

I'm thinking no.

Regards,

Richard.

-- 
Richard Quadling.

-- 
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.

Reply via email to