CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> .NET

 Modal window how-to

Print topic Send  topic

Author Message
dragoon


Posts: 173
Posted: 11/10/2010, 1:30 AM

Hi there,

As many reported in .NET forums that the modal is not working or disapearing after a couple of seconds here is a solution.

Consider the following scenario:
- grid / editable grid with a column with link control
- a record form to be shown in modal window (with additional details of the grid row)

Solving the puzzle:
1. put an onclick event in link control:
onclick="ShowModal1_show();return false;"  
"return false" prevents the page being refreshed (this is why the modal disapears)

2. the above solution is working as long you don't need to pass a parameter to the record in the modal; in this case you need to let the page to refresh a get the needed parameter from the URL.
To get the modal working put the following script in the onload event of the page

var url = window.location.href;  
if (url.indexOf("parameter_id") > 0) {  
	ShowModal1_show();  
}  
this part of the code should be the last in the onload event of the page

3. Have a button or a link in the modal window with the following code
onclick="ShowModal1_hide();return false;"  
put "return false" only when you don't want the page to refresh.
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright 2003-2004 by UltraApps.com  and YesSoftware, Inc.