@@ -107,6 +107,48 @@ <h1>Bootstrap Tags Demo</h1>
107107 </ style >
108108 </ div >
109109 </ div >
110+ < div class ="row ">
111+ < div class ="span4 "> < h3 > Tags in a Form</ h3 >
112+ < p > This is an example of including tags in a form and using a custom function when duplicate tags are added.</ p >
113+ </ div >
114+ < form >
115+ < div id ="bs-tags-form "> </ div >
116+ < button type ="submit " class ="btn "> Submit</ button >
117+ < style type ="text/css ">
118+ button {
119+ margin-left : 30% ;
120+ }
121+ # bs-tags-form .tag-badge {
122+ margin-right : 5px ;
123+ margin-bottom : 5px ;
124+ font-weight : 100 ;
125+ font-size : 14px ;
126+ line-height : 20px ;
127+ }
128+ # bs-tags-form .tag-icon {
129+ margin-left : 5px ;
130+ margin-right : -3px ;
131+ }
132+ # bs-tags-form .tag-badge a .tag-link {
133+ color : # ffffff ;
134+ text-decoration : underline;
135+ }
136+ # bs-tags-form .tag-input {
137+ border : 0 solid;
138+ margin : 0 ;
139+ padding : 0 ;
140+ font-weight : 100 ;
141+ border : 0 solid;
142+ background-color : transparent;
143+ height : 18px ;
144+ margin-top : -5px ;
145+ color : # ffffff ;
146+ outline : none;
147+ }
148+ </ style >
149+ </ form >
150+ </ div >
151+ </ div >
110152 < br > < br >
111153 < div id ="disqus_thread "> </ div >
112154 < script type ="text/javascript ">
@@ -149,6 +191,15 @@ <h1>Bootstrap Tags Demo</h1>
149191 } ,
150192 values_url : 'urls/default_users.json'
151193 } ) ;
194+ $ ( '#bs-tags-form' ) . tags ( {
195+ suggestions : [ "Banana" , "Durian" , "Cocos" ] ,
196+ suggestion_url : "urls/suggestions.json.php" ,
197+ values_url : 'urls/defaults.json' ,
198+ onDuplicate : function ( original , duplicate ) {
199+ $ ( original ) . hide ( ) . fadeIn ( ) ;
200+ return false ;
201+ }
202+ } ) ;
152203</ script >
153204</ body >
154205</ html >
0 commit comments