Results 1 to 4 of 4
Thread: Javascript Help
-
01-10-2011, 02:45 PM #1Web Hosting Evangelist
- Join Date
- Aug 2007
- Location
- Oakham England
- Posts
- 503
Javascript Help
Hey,
I cant get this JS to work, can anyone help me?
HTML Code:<form> <ul class="addedfields"> <li><input type="text" name="field[]" class="textbox" /> <input type="button" class="removebutton" value="remove"/></li> </ul> <input type="button" class="addbutton" value="add"/> </form> <script language="javascript"> $(function(){ $(".addbutton").click(){ if(".addedfields").length < 10){ $(".addedfields").append( '<li><input type="text" name="field[]" class="textbox" />' + '<input type="button" class="removebutton" value="remove"/></li>' ); } } // live event will automatically be attached to every new remove button $(".removebutton").live("click",function(){ $(this).parent().remove(); }); }); </script>
Streama - Your WordPress Friend
http://www.streama.co.uk
-
01-11-2011, 07:31 PM #2Newbie
- Join Date
- Jan 2011
- Posts
- 10
Can you show your page header?
-
01-12-2011, 05:38 PM #3Junior Guru Wannabe
- Join Date
- Oct 2010
- Posts
- 68
Assuming you have a proper header (loaded jQuery on HEAD tag), look for this line:
Code:if(".addedfields").length < 10){
Code:if($(".addedfields").length < 10){
Code:if($(".addedfields li").size() < 10){
██ DomainWink - Shared Web and Reseller Hosting with 24/7 Customer Support
██ cPanel with 1-Click Script Installs | Anytime Money Back Guarantee | Free 30 Days Trial, No CC Required
██ Visit us: www.domainwink.com
-
01-14-2011, 08:09 AM #4Newbie
- Join Date
- Jan 2011
- Posts
- 7
thanks for help sir
Android Game Development
Blogging Tips
Similar Threads
-
Need javascript help
By hoachen in forum Programming DiscussionReplies: 3Last Post: 12-21-2005, 11:13 AM -
javascript function has no properties in javascript console
By mrblack in forum Programming DiscussionReplies: 2Last Post: 05-25-2005, 02:15 PM -
Javascript
By pztup in forum Programming DiscussionReplies: 5Last Post: 12-13-2004, 02:48 AM -
javascript help
By ilyash in forum Programming DiscussionReplies: 4Last Post: 04-12-2003, 11:08 AM