I want to add two dynamic text box to enter “IP Range From” to “IP Range To” and one add more button to insert new IP Range plus validations to test those ranges.
Please suggest the code.
Waiting for your early response.
Thanks in Advance
Tanu
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Asuming you use jQuery, if i were you, i would create a DIV with the “textbox-list” and just after the div, a button to add new textbox in the above div.
Here is the part of code :
Then just add a
.click()event on the idnew_iprangeto dynamically add a line which contains 2 input with unique ID (static text + increment a var). I suggest you to define general span with a class for each line, such as “linecontainer”, and then just add a “title” property to your span with the increment var used above.After few clicks, your div would look like that :
Finally when you validate your form just use the jquery selecter to retrieve every line in your Div, and use a
.each()to iterate between your lines :That’s just an idea, i let you do the rest 😉 !