Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

html - Cloning with jQuery -


i have form allows users refer friends. want add link below 2 input fields, "friend email" , "friend name", clone "friend-box" 1 time , add below. in addition, name attribute of "friend email" , "friend name" name="friend_email[0]" , name="friend_name[0]" suggested here. what's best way clone , increment subscript? here's code:

<div class="friend-box">      <div class="field">         <span><label for='friend_name'><strong>friend's name *</strong></label> </span>         <input id='friend_name' name='friend_name[0]' type='text' />     </div>      <div class="field">         <span><label for='friend_email'><strong>friend's email *</strong></label></span>         <input id='friend_email' name='friend_email[0]' type='text' />     </div>  </div> 

what's best way this? 1 of problems had example, when cloned "friend-box" once , twice, cloned exponentially. i'm guessing need have id number in there , increment it. or, method saw, clone "friend-box" when page loads , keep cloning memory.

thanks, ryan

i have created example here: http://jsfiddle.net/k8hhw/5/

you not need worry incrementing numbers in brackets, form automatically you.


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -