$.get jquery question on how to open up into new window

I'm using a jquery and coldfusion search interface.  When the user enter text and select search button, I would like for the results to display in a new popup window and not within the same window....How can i do this...see code below:

<script>
$(document).ready(function(){
var search = $("#searchText").val()
if($.trim(search) == '') return false
$.get('search.cfm',{search:search},
function(data, status) {
$("#results").html(data)
})
return false
})
});
</script>

<form id="searchForm"><input type="text" id="searchText" /><input type="submit" value="Search" /> </form>

<div id="results"> </div>
melvint91Asked:
Who is Participating?
 
HainKurtSr. System AnalystCommented:
minor fix to above:

<form id="searchForm" action="search.cfm" target="_blank" onSubmit="chkForm()">
-->
<form id="searchForm" action="search.cfm" target="_blank" onSubmit="return chkForm()">
0
 
HainKurtSr. System AnalystCommented:
try this
<script>
function chkForm(){
  var search = $("#searchText").val();
  if($.trim(search) == '') {
    alert("please enter something!");
    return false; 
  }
  return true;
}
</script>

<form id="searchForm" action="search.cfm" target="_blank" onSubmit="chkForm()">
<input type="text" id="searchText" /><input type="submit" value="Search" />
</form>

Open in new window

0
 
webhansonCommented:
What kind of popup are you looking for? if it's not a new window as above you could use the jquery dialog?

Let me know if you want me to explain.
0
 
melvint91Author Commented:
none
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.