PDA

View Full Version : DHTML Window and forms



thunderai
02-12-2013, 01:42 AM
1) Script Title:

DHTML Window widget (v1.1)

2) Script URL (on DD):

http://www.dynamicdrive.com/dynamicindex8/dhtmlwindow/index.htm

3) Describe problem:

My question is about how to get a DHTML window to work with forms. A DHTML window can gain access to the form of the loader page; however, a DHTML window can not participate in the setting for form inputs. For example, let us say you have PHP pull some data from MYSQL and the loader page is the results of that search. If you were to have a DIV that you manually display that has filtering criteria for that search it works; however, once you create the same DIV via DHTML window Widget the filter settings no longer work as if the inputs in the DIV don't exist. I have tried it with leaving the DHTML window open and submitting the form, closing the window and just minimizing the window. In all cases the DHTML window filter inputs will not work - even though they do work if you show the DIV through a separate javascript display method.

Is there a way to make the DHTML window work?

Thanks.

ddadmin
02-12-2013, 07:08 PM
Firstly, are you using the IFRAME option of the script to load pages inside the DHTML window? Secondly, do you have a quick online example of the issue?

thunderai
02-13-2013, 12:01 AM
Firstly, are you using the IFRAME option of the script to load pages inside the DHTML window? Secondly, do you have a quick online example of the issue?

No I am using the 'div' flag. The window is created using the following command:



$fieldname = 'filters';
$Field_name = 'Field_MM'.$fieldname;
onClick="divwin_<?php echo $fieldname;?>=dhtmlwindow.open('sorting_controls_div', 'div', 'sorting_controls', 'Search Filters', 'width=250px,height=150px,left=200px,top=150px,resize=1,scrolling=1'); return false"


it makes no difference if I remove the 'return false' statement or not.

the code for the actual div is:



<div style="display:block;left:500px;top:300px;position:fixed;z-index:50;width:250px;height:150px;" name="sorting_controls" id="sorting_controls" />
<table width="100%" class="perp_mainmenutable" />
<tr>
<td>
<?php
// Load Control Buttons
_tp_control_sortby_joined($tbl_show_joinedsort ,1 ,$en_joined ,$en_turned_off ,$en_active ,$en_notactive ,'frmjoined' ,'frmjoinedactive' ,'notused' ,$frmjoined);
_tp_control_sortby_archieved($tbl_show_archivedsort ,1 ,$en_archived ,$en_turned_off ,$en_active ,$en_notactive ,'frmarchives' ,'frmarchivesactive' ,'notused' ,$_POST['frmarchives']);
_tp_control_sortby_closed($tbl_show_closedsort ,1 ,$en_closed ,$en_turned_off ,$en_active ,$en_notactive ,'frmclosed' ,'frmclosedactive' ,'notused' ,$_POST['frmclosed']);
_tp_control_sortby_duplicate($tbl_show_duplicatesort,1 ,$en_duplicate ,$en_turned_off ,$en_active ,$en_notactive ,'frmduplicate' ,'frmduplicateactive' ,'notused' ,$_POST['frmduplicate']);
_tp_control_sortby_date($tbl_show_datesort ,$tbldatesort ,$en_start_date ,$en_turned_off ,'frmstartdate' ,$uifrmstartdate,'Calendar1');
_tp_control_sortby_date($tbl_show_datesort ,$tbldatesort ,$en_end_date ,$en_turned_off ,'frmenddate' ,$uifrmenddate ,'Calendar2');

_tp_control_sortby_text($tbl_show_textsort ,$tbltextsort ,$en_textlike ,$en_turned_off ,'frmtextlike' ,$frmtextlike ,'not used');
_tp_control_sortby_page($sql ,$sql_failsafe ,$en_select_page ,$tblpagationgroup ,'pageation' ,'formoptionpageation' ,$_POST['formoptionpageation']);
_tp_control_function_submit();
?>
</td>
</tr>
</table>
</div>

ajfmrf
02-13-2013, 04:06 AM
Please post a link to your page .this will help determine the problem

thunderai
02-13-2013, 04:51 AM
Please post a link to your page .this will help determine the problem

It is all in a production environment on my computer. Not sure how I want to open that for inspection...

ddadmin
02-13-2013, 01:51 PM
Hmm with the "div" mode, you risk the chance of all sorts of problems if the markup has JavaScript functionality tied to it, since in this case you're basically duplicating the markup from one part of the page to the next whilst probably not modifying your JavaScript to take into account that.

Is switching to the IFRAME mode an option (so the form is stored inside its own page and embedded on the loader page and DHTML window that way?

thunderai
02-13-2013, 02:00 PM
There is javascript that controls how some of the controls work, and there is an assciated ajax call to refresh the page on one control as well. if I did change it to an iframe call, how would you suggest I rework the form inputs that control how the loader page is displayed?

I'll check the javascript errors and see what is applicable to the DHTML window failing. If I fidn anythign I'll let you know.


Thanks.

ddadmin
02-14-2013, 04:53 AM
There is javascript that controls how some of the controls work, and there is an assciated ajax call to refresh the page on one control as well. if I did change it to an iframe call, how would you suggest I rework the form inputs that control how the loader page is displayed?


Thanks.

Without seeing the actual rendered page/form in action, it's hard to give specific advice, though in general, I reckon you'd include the form onto the loader page using either SSI or PHP, and for the DHTML window, obviously via IFRAME.