473,511 Members | 15,852 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to dynamically hide and show rows in a formview using javascript

8 New Member
Dear all,

I have a formview in which i have a DropDownList for selecting languages...there is also a add more button which when clicked shows 5 more dropdownlists so the user can select more langauges....

i have worked everything out....i made 5 additional rows below the languages DDList and set them to runat="server" and then i find these rows using the FormView1.FindControl method and make them Visible=false in the FormView1_PreRender() function...i use a session varaiable to keep track of the times the add more language button was clicked...

when clicked the page is postback and basically everything works.....but i have a form view there is a lot of datbase access going on and then it takes a lot of time...so i wanted to use javascript so that these rows can be made visible without reloding the page again.....

i dont know javascript much so i please guys if u could point me in the right direction it would be much appreciated
Feb 16 '09 #1
3 4567
Frinavale
9,735 Recognized Expert Moderator Expert
Are there a fixed number of additional rows that that they can add?
Feb 18 '09 #2
pankajsingh5k
8 New Member
thanks for your time

one dropdownlist is displayed and the user can show upto five additional rows...making a total of 6....that means 6 postbacks.....

i found a trick on http://mattberseth.com/blog/2007/07/...nels_with.html which tells how one can lazy load the tabs but i am having a problem in it as well..which i have posted in the JAVASCRIPT/AJAX section.....even so if only one tab loads even so i was wishing javascript would allow me to show more dropdownlists without server roundtrips....

thanks
Feb 19 '09 #3
Frinavale
9,735 Recognized Expert Moderator Expert
This is possible.

Load all of the rows as normal and then use a JavaScript function to hide or display them according to what has been selected in the DropDownList.
You will have to somehow indicate to the JavaScript which rows to hide...so you can use a HiddenField, or create a JavaScript Array to store/pass the ClientIDs of the rows to the JavaScript function....Or you could use JavaScript to traverse through the HTML generated for FormView to locate the appropriate rows.

I don't understand what tabs have to do with hiding and displaying rows in a formview though?
Feb 19 '09 #4

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

Similar topics

3
27127
by: Harry | last post by:
I want to provide a drill down facility for the users - the plan is to intially display a table with summary rows containing results of previous selected search criteria. In each summary row you...
9
33397
by: Wang, Jay | last post by:
I try to group several rows in a table into a div and show/hide them by click on a button somewhere with a javascript link. When clicked, the link will toggle the style of the div section's style...
19
6855
by: dmiller23462 | last post by:
Hi guys....I have absolutely NO IDEA what I'm doing with Javascript but my end result is I need two text boxes to stay hidden until a particular option is selected....I've cobbled together the...
10
4626
by: oLE | last post by:
I would like to add some javascript to show/hide a certain row of a table. The first row of the table contain the hyperlink that calls the javascript the second row is the one i want to show/hide...
12
15635
by: Jerad Rose | last post by:
I searched for a while trying to find the answer to this, but to no avail. I am trying to find the best way (or any way) to dynamically show and hide groups of TR's. For example, I have a...
2
2894
by: Chad | last post by:
I have a problem that I am desperate to understand. It involves dynamically adding controls to a Table control that is built as a result of performing a database query. I am not looking to...
11
8000
by: jimstruckster | last post by:
I have a table with 10 rows, I want all rows except for the first to be hidden when the page first opens up. If the user puts a value in a text box in the first row then I want the second row to...
4
2953
by: mohaaron | last post by:
I can think of a lot of reasons why this might need to be done but as far as I can tell it's not possible. I've been looking for a way to add HtmlTableRows to a table using a button click for a...
18
7525
by: Liquidtouch | last post by:
I have been searching on this for awhile and cant find anything and playing around with it got me no where. I will start with what I am after and then explain what I have. I have a table with 3...
0
7242
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,...
1
7075
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...
0
7508
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5662
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,...
0
4737
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...
0
3222
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...
0
1572
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
781
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
446
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.