473,738 Members | 7,599 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

clone element input JavaScript with null value

1 New Member
Expand|Select|Wrap|Line Numbers
  1. $(document).ready(function() {
  2.             $('#btnAdd').click(function() {
  3.                 var num     = $('.clonedInput').length;
  4.                 var newNum  = new Number(num + 1);
  5.  
  6.                 var newElem = $('#input' + num).cloneNode(true).attr('id', 'input' + newNum);
  7.  
  8.                 newElem.children(':first').attr('id', 'name' + newNum).attr('name', 'name' + newNum);
  9.                 $('#input' + num).after(newElem);
  10.                 $('#btnDel').attr('disabled','');
  11.  
  12.                 if (newNum == 5)
  13.                     $('#btnAdd').attr('disabled','disabled');
  14.             });
  15.  
Sep 25 '12 #1
1 1756
Dormilich
8,658 Recognized Expert Moderator Expert
a little more description would be helpful.
Sep 26 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
11786
by: Tom Esker | last post by:
I've got Javascript in a form that adds up all of the numbers in a column of form fields and displays a total. It works great if every field has an initial value of 0, but if any of them are null, "NaN" displays as the total. I tried to add a test for a null value with the intent to skip adding that field to the accumulator for one iteration of the "for" loop, but it doesn't work. Can anyone tell me what I'm doing wrong? Below is the...
0
1842
by: richard | last post by:
Hi, I have a Schema for a Dataset which I am populating from Excel. One of the columns is a string datatype. When I Fill the Dataset I want any Null values to be set to a string value. I have seen varies articles using this namespace xmlns:codegen="urn:schemas-microsoft-com:xml-msprop" This allows you to use the codegen:nullValue="" in the xs:element of the Schema.
3
13535
by: Lynn | last post by:
Hi all, I am having problem when did the validation of XML document with Schema. my schema is like the following: <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="schema.xsd" xmlns:msprop="urn:schemas-microsoft-com:xml-msprop" elementFormDefault="qualified" targetNamespace="schema.xsd"> <xsd:element name="bookstore" type="bookstoreType" /> <xsd:complexType name="bookstoreType"> <xsd:sequence maxOccurs="unbounded">...
0
1711
by: Benny Raymond | last post by:
reply to: benny@pocketrocks.com if possible: I'm trying to set up a hierarchy system in this database where each row can be related to a previous row. The problem is that when I go to addTreeRow, it doesn't allow me to use Convert.DBNull for the childof column, even though I have nilable set to true. (All parent nodes have to be set to null, since they are not the child of any other row... especially the very first row, which will have...
1
11475
by: David Shorthouse | last post by:
Hey folks, I am attempting to pass null as the input value from a series of textboxes if the user does not input a value prior to submit. To try and do this, I am using a vbscript function on this asp as follows: CommentsAdd = IIf(Request.Form("Comments")="",NULL,Request.Form("Comments")) I was hoping this would convert those emptystring textboxes to null.
4
2359
by: Reuven Nisser | last post by:
Hi All, How to define an XML element with no value and no attribute? <X> <Y/> </X> And Y has no value? I've done it with:
4
4238
by: keithb | last post by:
What is the correct syntax to detect whether a DataTable Row.ItemArray element is a null value? using: if (row.ItemArray == null ) does not seem to work. Thanks,
4
1680
by: ina | last post by:
Hello all, I am newbie in xml and have a problem with this parse. I have this xml.file <Style> <Strategy>
7
34860
by: kumar.senthil | last post by:
Hi, I'm using XmlSerializer to create an object from the XML string. I would like to know whether I can get a null value for an empty XML element. Actually the XmlSerializer assigns "" (empty string) for a string if the corresponding element is missing in the XML. Input XML: <DemoClass><A>some value</A><B></B><DemoClass>
2
2154
by: shankwheat | last post by:
I'm having trouble adding two values together when one of them has a null value // These two values come from a database CEOBonusValue = 550000 CEONonEqIncentCompHidden == null This should alert to true but doesn't
0
8969
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9476
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9335
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9263
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8210
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6053
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4570
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4825
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2745
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.