Onclick Increase textfields in same form

activesoftware used Ask the Experts™
dear ,

i have four checkboxes.

checkboxes are not constant it comes from DB.

i want if user click on first checkbox then two textbox come below and if user click on next checkbox acording to check box clicked new text box comes then after so on when user click on the checkbox then new textboxes comes as per db conditions ( condition is this - on click every checkbox there's condition in DB that one textbox comes or two )

so i want every checkbox click new text box coming without hiding lastone.

now i am useing jquery on every click textboxes coming right but when we click next checkbox previous one onclcik result hide and newone come. i try on web lot.

not found so please help me.

Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
It should be easy, you just have to assign the class to checkbox dynamically depending upon that condition.
Then, when you click on the checkbox, you can check the class of that checkbox and decide whether you want to display 2 checkbox or 1



when user click on checkbox then we need to send call to DB then after that from DB we can check ( from checkbox Id ) which condition is applicable for this checkbox ( there's two conditions -

1. checkbox no 1. - when click - need to show 3 textbox in horizontal line
2. checkbox click then only show two checkbox

checkbox can come in alternate way. only way to show need to check from DB then after click we need to check conditions from two tables )

so please tell me jquery to generate text boxes dynamically.

i think it is not a good design to make a server side db call to get the information for a checkbox at the click event of it.

I would suggest that you first get all the information for the checkbox and then render them dynamically so that while rendering them itself, you will be assigning a class to them, as i mentioned above.


Not Proper Answer

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial