Solved

Jquery UI, external modal dialog window

Posted on 2011-03-18
3
1,400 Views
Last Modified: 2012-05-11
Hello all,
I am having many troubles with Jquery (I am a newbie). I would like to open external content inside of a Jquery UI dialog box and get clicked link's href attribute inside of my form input area.

// Opening Images window
$('input[name=image]').click(function() {
	var imageUrl = "<?php echo SITE_URL;?>external.php?do=select_image";
	$( "#dialog" ).dialog({ width: 500, height: 400 });
	$( "#dialog" ).load(imageUrl, function() {
		$( "#dialog" ).dialog('open');
		return false;
	});
});

Open in new window


I couldn't get the dialog window open, instead it is just trying to redirect. Any idea how can I do that?

Thank you for your help and time in advance.
0
Comment
Question by:pixalax
  • 2
3 Comments
 
LVL 40

Accepted Solution

by:
gurvinder372 earned 500 total points
ID: 35167120
1
 
LVL 2

Author Comment

by:pixalax
ID: 35167743
Hello gurvinder372,
 Thank you for your reply.

<form>
<input type="text" name="image" value="">
</form>
<div id="dialog" title="Popup Dialog">
</div>
<script>
$('input[name=image]').click(function() {
	var imageUrl = "<?php echo SITE_URL;?>external.php?do=select_image";
	$( "#dialog" ).dialog({ width: 500, height: 400 });
	$( "#dialog" ).load(imageUrl).dialog('open');
});
</script>

Open in new window


Still the same problem. Trying to redirect to imageUrl. No dialog box is opening.
0
 
LVL 2

Author Closing Comment

by:pixalax
ID: 35168414
Sorry my bad. The external page I was trying to open in modal box had some JS inside. Because of that I had problems. Actually what I did in the beginning was working perfectly. Problem was JS file in external file.

Thank you for your help.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now