Hi
scenario is:
1 If user enter Number of floor = 1 then Floor Number and Area textbox show otherwise hidden
No Of Floor
Floor No
Area
.
.
.
Floor No
Area
Hi
scenario is:
1 If user enter Number of floor = 1 then Floor Number and Area textbox show otherwise hidden
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Sachin SinghRank #66 · 26.2K reputationPosted Dec 19, 2022, 1:11 AM EST
It is not displaying floor and area number because you are not setting the value, copy paste below and test
for (let i = 1; i Floor No ${i} Area ${i} ` } parent.innerHTML = inner; });Garima BansalRank #1,555 · 1K reputationPosted Dec 16, 2022, 1:45 AM EST
If number of floor is one then its shows only one floor Number and Area textbox and if user enter number of floor is 3 then it shows two floor number and area textbox
Pankajkumar PatelRank #181 · 13.4K reputationPosted Dec 16, 2022, 2:35 AM EST
Hi Garima Bansal,
One way is like following:
Hope this will help you!
Sachin SinghRank #66 · 26.2K reputationPosted Dec 18, 2022, 1:46 PM EST
simply wrap the floor number and area in a single div and show and hide the div instead.
$(function(){ $("id^=floorscheck").hide(); // hide all on page load until any floor number is entered }) $("#NoOfFloor").change(function(){ $("id^=floorscheck").hide(); $("id=floorscheck"+$(this).val()).show(); })Sachin SinghRank #66 · 26.2K reputationPosted Dec 19, 2022, 12:25 AM EST
@garima
what you are doing in your code is, you are asking the user to enter a number if he enters 4 then you are creating 4 div (div0 to div3).
Do you want this behavior? Or just the the 4th floor (entered ) one?
also even if you want to generate 4 div if a user enters 4 then start from 1 instead of 0.
for (let i = 1; i Floor No Area ` } parent.innerHTML = inner; });Garima BansalRank #1,555 · 1K reputationPosted Dec 19, 2022, 12:10 AM EST
Hello Pankaj Patel and Sachin Singh
No Of Floor
i implemented this way but only problem with this way Floor No 1 and Area 1......Floor No 5 and Area 5 not mentioned
Garima BansalRank #1,555 · 1K reputationPosted Dec 19, 2022, 12:53 AM EST
Sachin Singh
the way i am doing works fine but the only problem is it not display
Floor No 1
Floor No 2
Floor No 3

and see frontend snippet below
Garima BansalRank #1,555 · 1K reputationPosted Dec 19, 2022, 1:10 AM EST
Now its work fine in all scenario
for (let i = 0; i < value; i++) {
inner += `
}
parent.innerHTML = inner;