I have a series of checkboxes and an input text field next to each one. I have a js search pop-up window that opens when a user clicks in the text field. This works fine, however I would also like the checkbox next to it to automatically be checked at the same time. The pop-up works fine, however I'm not sure how to also dynamically check the box the same time the pop-up window opens.
Here is just one of the checkbox/text fields:
<input type="checkbox" name="part_Ops" value="1">
<input type="text" name="part_Name" onFocus="jsPopupWindow('frmSet_search_for_name.cfm?nameField=ispart_OpsName&frmName=frmParties&nextField=part_EHD','part_EHD')">
Here's the js that pops-up the search window:
<script language="javascript">
function jsPopupWindow(url,nextField) {
//alert(url);
var popupWindow;
if (document.all)
var xMax = screen.width, yMax =
screen.height;
else
if (document.layers)
var xMax = window.outerWidth,
yMax = window.outerHeight;
else
var xMax = 640, yMax=480;
var xOffset = (xMax - 250)/2, yOffset = (yMax - 250)/2;
if (url ==
"frmSet_search_for_name.cfm?nameField=ispart_OpsName&frmName=frmParties&
nextField=part_EHD") {
document.frmParties.part_Ops.checked=true && document.frmParties.part_EHD.focus();
}
popupWindow = window.open(url, "popupWindow", "toolbar=no,menubar=no,scrollbars=yes,resizable=yes,height=450,width=770
,screenX='+xOffset+',screenY='+yOffset+',
top='+yOffset+',left='+xOffset+'");
popupWindow.focus();
}
Here is just one of the checkbox/text fields:
<input type="checkbox" name="part_Ops" value="1">
<input type="text" name="part_Name" onFocus="jsPopupWindow('frmSet_search_for_name.cfm?nameField=ispart_OpsName&frmName=frmParties&nextField=part_EHD','part_EHD')">
Here's the js that pops-up the search window:
<script language="javascript">
function jsPopupWindow(url,nextField) {
//alert(url);
var popupWindow;
if (document.all)
var xMax = screen.width, yMax =
screen.height;
else
if (document.layers)
var xMax = window.outerWidth,
yMax = window.outerHeight;
else
var xMax = 640, yMax=480;
var xOffset = (xMax - 250)/2, yOffset = (yMax - 250)/2;
if (url ==
"frmSet_search_for_name.cfm?nameField=ispart_OpsName&frmName=frmParties&
nextField=part_EHD") {
document.frmParties.part_Ops.checked=true && document.frmParties.part_EHD.focus();
}
popupWindow = window.open(url, "popupWindow", "toolbar=no,menubar=no,scrollbars=yes,resizable=yes,height=450,width=770
,screenX='+xOffset+',screenY='+yOffset+',
top='+yOffset+',left='+xOffset+'");
popupWindow.focus();
}