XHTML:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
| <script type="text/JavaScript"> AIM = { frame : function(c) { var n = 'f' + Math.floor(Math.random() * 99999); var d = document.createElement('DIV'); d.setAttribute("id", "iframediv"); //(ID SET)// d.innerHTML = '<iframe style="display:none" src="about:blank" id="'+n+'" name="'+n+'" onload="AIM.loaded(\''+n+'\')"></iframe>'; document.body.appendChild(d); var i = document.getElementById(n); if (c && typeof(c.onComplete) == 'function') { i.onComplete = c.onComplete; } return n; }, form : function(f, name) { f.setAttribute('target', name); }, submit : function(f, c) { AIM.form(f, AIM.frame(c)); if (c && typeof(c.onStart) == 'function') { return c.onStart(); } else { return true; } }, loaded : function(id) { var i = document.getElementById(id); if (i.contentDocument) { var d = i.contentDocument; } else if (i.contentWindow) { var d = i.contentWindow.document; } else { var d = window.frames[id].document; } if (d.location.href == "about:blank") { return; } if (typeof(i.onComplete) == 'function') { i.onComplete(d.body.innerHTML); } } } // // afhandelingen // function startCallback() { // make something useful before submit (onStart) document.getElementById('loader').innerHTML = "<img src='IMG/loading_circle.gif' alt='loading...' title='' /><span class='aanwezig'> Een ogenblik geduld a.u.b...</span>"; return true; } function completeCallback(response) { // make something useful after (onComplete) document.getElementById('loader').innerHTML = ""; document.getElementById('debresult').innerHTML = response; return true; } </script> <form id="debzoeker" enctype="multipart/form-data" method="post" action="scripts/debiteur_result.php" onsubmit="return AIM.submit(this, {'onStart' : startCallback, 'onComplete' : completeCallback});" > <table style="width:660px;border:0px solid;"> <tr> <!-- //Het invulveld welke wordt gefocust bij loading --> <td style="width:100px;" valign="middle">Zoekcriteria</td> <td style="width:560px;" colspan="2"> <input type="text" id="trefwoord" name="trefwoord" value="<?php echo trim($_SESSION['deb_trefwoord']); ?>" /> <input class="zoekknop" type="submit" id="submit" name="submit" value="" /> </td> </tr> </table> </form> <script type="text/JavaScript"> document.getElementById('trefwoord').focus(); if (trim(document.getElementById('trefwoord').value) != '' && document.getElementById('trefwoord').value != 'Uw zoekcriteria...') { document.getElementById('trefwoord').select(); function altsubmit() { var form = document.forms['debzoeker']; form.submit; } altsubmit(); } </script> |
Het probleem in bovenstaande code is het feit dat wanneer ik het form automatisch wil laten posten indien er automatisch een trefwoord is ingevuld aan de hand van de PHP-sessie, dit niet werkt.
Dit doe ik in de JS-functie "altsubmit();" , Waarbij ik ipv form.submit; ook de volgende combinaties heb geprobeerd;
- AIM.submit(form, {'onStart' : startCallback, 'onComplete' : completeCallback});
- document.forms['debzoeker'].elements['submit'].submit;
- form.onsubmit();
Bij de tweede combinatie doet niets het en krijg ik een syntaxfout
Bij de eerste en derde combinatie krijg ik de volgende fout in IE8;
Foutdetails webpagina
Gebruikersagent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30)
Tijdstempel: Wed, 21 Oct 2009 07:36:44 UTC
Bericht: HTML Parsing Error: Unable to modify the parent container element before the child element is closed (KB927917)
Regel: 0
Teken: 0
Code: 0
URI: http://localhost/index.php?afd=1&page=1
In firefox krijg ik geen foutmleding en wordt er wel een start gemaakt met de onStart-functie 'startCallback', maar gebeurt er verder ook niets.
Wat doe ik hier nu fout? Er is behoorlijk weinig te vinden over dit icm de foutgegevens van IE8.
Kan iemand mij verder helpen?
Tannoy Revolution R3 105W 6ohm, Marantz PM-7003 2x70W 8ohm, 2x JVG goud/goud, Marantz CD-6003, Marantz ST-6003