Jump to content

Bogey

Members
  • Posts

    265
  • Joined

  • Last visited

Everything posted by Bogey

  1. Finally got it working! <form action="login.php" method="post" id='formLOGIN'><input type="text" name="username" placeholder="Email"/><input type="password" name="password" placeholder="Password" onkeyup="if (event.keyCode == 13) document.getElementById('formLOGIN').submit()"/><input type="submit" class="button_login" name="btn_login" id="btn_login" value=""/></form>
  2. this did it: windowpopup1.php <form name="buttonForm"><input type="button" value="<?php echo $button1val;?>" onclick="opener.buttonClicked(0, '001');"/> <input type="button" value="<?php echo $button2val;?>" onclick="opener.buttonClicked(1, '001');self.close();"/></form> windowpopup2.php <form name="buttonForm"><input type="button" value="<?php echo $button1val;?>" onclick="opener.buttonClickedVerkocht(0, '001');self.close();""/> <input type="button" value="<?php echo $button2val;?>" onclick="opener.buttonClickedVerkocht(1, '001');self.close();"/></form> thnx again!!!!
  3. www.lons.nl is the page where I am testing this issue
  4. Here I am again lol index.php <!DOCTYPE html PUBliC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="X-UA-Compatible" content="IE=8" /><meta http-equiv="content-type" content="text/html; charset=utf-8" /><meta http-equiv="Content-Language" content="nl" /><script type="text/javascript" src="/test.js"></script></head><body id="body"><a href="javascript:void(0)" onclick="showDelete('delete','001')">Delete</a></body></html> test.js winConfirm = null;function showDelete(kind,opdrachtID){ alert ("showDelete"); var windowWidth = 250;var windowHeight = 100;var locX = ( screen.width - windowWidth ) / 2;var locY = ( screen.height - windowHeight ) / 2;var windowFeatures = "width=" + windowWidth + ",height=" + windowHeight +",screenX=" + locX + ",screenY=" + locY + ",left=" + locX + ",top=" + locY;winConfirm = window.open("windowpopup1.php", "winConfirm", windowFeatures);}function showDeleteNEW(){ alert ("showDeleteNEW"); var windowWidth = 250;var windowHeight = 100;var locX = ( screen.width - windowWidth ) * 5;var locY = ( screen.height - windowHeight ) * 5;var windowFeatures = "width=" + windowWidth + ",height=" + windowHeight +",screenX=" + locX + ",screenY=" + locY + ",left=" + locX + ",top=" + locY;winConfirm = window.open("windowpopup2.php", "winConfirm", windowFeatures);}function buttonClicked(buttonChoice,opdrachtID){ alert ("buttonClicked");switch( buttonChoice ){case 0:alert ("case 0");showDeleteNEW();break;case 1:alert ("Not deleted!");break;default:document.myForm.showResult.value = "(void)";break;}} windowpopup1.php <?php$message = "Delete Item?";$button1val = "YES";$button2val = "NO";?><!DOCTYPE html PUBliC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html> <head> <meta charset="UTF-8"> <title></title> <script type="text/javascript" src="/test.js"></script> </head> <body BGCOLOR="#CCE0F5"><center><b><?php echo $message;?></b><form name="buttonForm"><input type="button" value="<?php echo $button1val;?>" onclick="buttonClicked(0, '001');self.close();"/> <input type="button" value="<?php echo $button2val;?>" onclick="buttonClicked(1, '001');self.close();"/></form></center></body></html> windowpopup2.php <!DOCTYPE html PUBliC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html> <head> <meta charset="UTF-8"> <title></title> <script type="text/javascript" src="/test.js"></script> </head> <body BGCOLOR="#CCE0F5"><center><p>TESTtestTEST</p></center></body></html> The alert ("showDeleteNEW") from function showDeleteNEW() is shown, but windowpopup2.php I still can't get appear. Sorry for all the inconvenience!
  5. I think it has to be with one of these lines in a pk.js file... any clues? Sorry for the many line, but I already brought it back from just under 900 line to 175 lines (also a lot of comments in there! ) jQuery.noConflict(); jQuery(document).ready(function(){ jQuery("#options_wrapper").pk_options_menu();}); /* * PK_OPTIONS_MENU ****/ function closeOptionsMenu() {jQuery("#options_wrapper div").filter(":visible").stop().slideUp(400, function() {jQuery("#options_wrapper").hide();});} (function($) {$.fn.pk_options_menu = function(options) {var defaults = {controls: "#options_menu li",easing: "easeOutExpo",speedIn: 400,speedOut: 100} var settings = $.extend({}, defaults, options); /**/ return this.each(function() {var $root = $(this);var $menu = $(settings.controls);var $items = $("div", $root);var $new_item = null; $root.hide(); $menu.each(function(i) {$(this).hoverIntent(function() {$new_item = $items.filter(":eq(" + i + ")"); if($new_item.css("display") == "none") {if($root.css("display") == "none") {$root.show();$items.filter(":visible").slideUp(0);$new_item.slideDown(settings.speedIn);} else {$items.filter(":visible").slideUp(settings.speedOut, function() {$new_item.slideDown(settings.speedIn);});}$new_item.bind("mouseleave", function() {closeOptionsMenu();});}}, function(){});});});};})(jQuery); /* * END PK_CODE ****/ /*** hoverIntent is similar to jQuery's built-in "hover" function except that* instead of firing the onMouseOver event immediately, hoverIntent checks* to see if the user's mouse has slowed down (beneath the sensitivity* threshold) before firing the onMouseOver event.* * hoverIntent r5 // 2007.03.27 // jQuery 1.1.2+* <http://cherne.net/brian/resources/jquery.hoverIntent.html>* * hoverIntent is currently available for use in all personal or commercial * projects under both MIT and GPL licenses. This means that you can choose * the license that best suits your project, and use it accordingly.* * // basic usage (just like .hover) receives onMouseOver and onMouseOut functions* $("ul li").hoverIntent( showNav , hideNav );* * // advanced usage receives configuration object only* $("ul li").hoverIntent({* sensitivity: 7, // number = sensitivity threshold (must be 1 or higher)* interval: 100, // number = milliseconds of polling interval* over: showNav, // function = onMouseOver callback (required)* timeout: 0, // number = milliseconds delay before onMouseOut function call* out: hideNav // function = onMouseOut callback (required)* });* * @param f onMouseOver function || An object with configuration options* @param g onMouseOut function || Nothing (use configuration options object)* @author Brian Cherne <brian@cherne.net>*/(function($) {$.fn.hoverIntent = function(f,g) {// default configuration optionsvar cfg = {sensitivity: 7,interval: 100,timeout: 200};// override configuration options with user supplied objectcfg = $.extend(cfg, g ? { over: f, out: g } : f ); // instantiate variables// cX, cY = current X and Y position of mouse, updated by mousemove event// pX, pY = previous X and Y position of mouse, set by mouseover and polling intervalvar cX, cY, pX, pY; // A private function for getting mouse positionvar track = function(ev) {cX = ev.pageX;cY = ev.pageY;}; // A private function for comparing current and previous mouse positionvar compare = function(ev,ob) {ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t);// compare mouse positions to see if they've crossed the thresholdif ( ( Math.abs(pX-cX) + Math.abs(pY-cY) ) < cfg.sensitivity ) {$(ob).unbind("mousemove",track);// set hoverIntent state to true (so mouseOut can be called)ob.hoverIntent_s = 1;return cfg.over.apply(ob,[ev]);} else {// set previous coordinates for next timepX = cX; pY = cY;// use self-calling timeout, guarantees intervals are spaced out properly (avoids JavaScript timer bugs)ob.hoverIntent_t = setTimeout( function(){compare(ev, ob);} , cfg.interval );}}; // A private function for delaying the mouseOut functionvar delay = function(ev,ob) {ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s = 0;return cfg.out.apply(ob,[ev]);}; // A private function for handling mouse 'hovering'var handleHover = function(e) {// next three lines copied from jQuery.hover, ignore children onMouseOver/onMouseOutvar p = (e.type == "mouseover" ? e.fromElement : e.toElement) || e.relatedTarget;while ( p && p != this ) { try { p = p.parentNode; } catch(e) { p = this; } }if ( p == this ) { return false; } // copy objects to be passed into t (required for event object to be passed in IE)var ev = jQuery.extend({},e);var ob = this; // cancel hoverIntent timer if it existsif (ob.hoverIntent_t) { ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); } // else e.type == "onmouseover"if (e.type == "mouseover") {// set "previous" X and Y position based on initial entry pointpX = ev.pageX; pY = ev.pageY;// update "current" X and Y position based on mousemove$(ob).bind("mousemove",track);// start polling interval (self-calling timeout) to compare mouse coordinates over timeif (ob.hoverIntent_s != 1) { ob.hoverIntent_t = setTimeout( function(){compare(ev,ob);} , cfg.interval );} // else e.type == "onmouseout"} else {// unbind expensive mousemove event$(ob).unbind("mousemove",track);// if hoverIntent state is true, then call the mouseOut function after the specified delayif (ob.hoverIntent_s == 1) { ob.hoverIntent_t = setTimeout( function(){delay(ev,ob);} , cfg.timeout );}}}; // bind the function to the two event listenersreturn this.mouseover(handleHover).mouseout(handleHover);};})(jQuery);
  6. Then the code runs.... so there has to be something in the template.... I go check it out! thnx!!! Let you know if I got it working
  7. Thank you very much for you answer.... I go try that one out (hopefully tomorrow). I will come back to this again soon. And let you know if it did make it work like I wish! thnx!!!!!!!!
  8. Doesn't work for me :s The slash I always use in HTML, to start from the root (so when page with the link moves to another directory the action still is valid). Not a wise thing to do? (I tried it without the slash, but did not help) The login.php is there! The <p> is cause I have bought a template. The use the <p> there and style it in css.
  9. Hi all, This is the code: <form action="/login.php" method="post"><p><input type="text" class="" name="username" placeholder="Email" /><input type="password" class="" name="password" placeholder="Password" /><input type="submit" class="button_login" name="btn_login" id="btn_login" value=""/></p></form> Chrome works fine! But IE: When pushing ENTER in IE after filled in the PASSWORD, then form doesn't submit. Searching made me find out its because there is only one textbox in form. More than one textbox should go further. But I want only ONE textbox. I did try it with a hidden textbox, but couldn't make it happen. Any ideas?
  10. Still can't get it working.... I changed a line (putting in a Timeout): function buttonClicked(buttonChoice,opdrachtID){switch( buttonChoice ){case 0://showConfirm('sold',opdrachtID);setTimeout(function (){showConfirm('sold',opdrachtID);}, 1000);break;case 1:alert ("Not deleted!");break;default:document.myForm.showResult.value = "(void)";break;} But now I get this error message in Chrome: Uncaught TypeError: Cannot read property 'document' of undefined This has to do with this line: winConfirm.document.writeln(theHTML); I guess winConfirm is not opening a window? In IE the error message gives me this: Kan de eigenschap document van een niet-gedefinieerde verwijzing of een verwijzing naar een lege waarde niet ophalen I english something like: Can't get the property 'document' of an undefined reference or a reference to an empty value
  11. Thanks... I will try that... I come back to it!
  12. Yes, but I don't see any errors there...
  13. Hi all, This is the line in the HTML-file: <a href="javascript:void(0)" onclick="showConfirm('delete','<?php echo $rowOpdrachten['id'];?>')" class='button radius'>DELETE</a> This is my javascript function: var winConfirm = null;function showConfirm(kind,opdrachtID){var windowWidth = 250;var windowHeight = 100;var locX = ( screen.width - windowWidth ) / 2;var locY = ( screen.height - windowHeight ) / 2;var windowFeatures = "width=" + windowWidth + ",height=" + windowHeight +",screenX=" + locX + ",screenY=" + locY + ",left=" + locX + ",top=" + locY;if ( ( winConfirm != null ) && !winConfirm.closed ){winConfirm.close();}winConfirm = open( "", "winConfirm", windowFeatures );if (kind=='delete'){var theHTML = '<HEAD><TITLE></TITLE></HEAD>'+ '<BODY BGCOLOR="#CCE0F5">'+ '<CENTER><B>'+ 'Are you sure you want to delete item?'+ '</B><FORM NAME="buttonForm">'+ '<INPUT TYPE="button" VALUE="YES"'+ ' ONCLICK="opener.buttonClicked(0,'+opdrachtID+');self.close();"/>'+ ' '+ '<INPUT TYPE="button" VALUE="NO"'+ ' ONCLICK="opener.buttonClicked(1,'+opdrachtID+');self.close();"/>'+ '</FORM></BODY>';winConfirm.document.writeln( theHTML );}if (kind=='sold'){var theHTML = '<HEAD><TITLE></TITLE></HEAD>'+ '<BODY BGCOLOR="#CCE0F5">'+ '<CENTER><B>'+ 'Is it sold?'+ '</B><FORM NAME="buttonForm">'+ '<INPUT TYPE="button" VALUE="SOLD"'+ ' ONCLICK="opener.buttonClickedVerkocht(0,'+opdrachtID+');self.close();"/>'+ ' '+ '<INPUT TYPE="button" VALUE="NOT_SOLD"'+ ' ONCLICK="opener.buttonClickedVerkocht(1,'+opdrachtID+');self.close();"/>'+ '</FORM></BODY>';winConfirm.document.writeln( theHTML );}function buttonClicked(buttonChoice,opdrachtID){switch( buttonChoice ){case 0:showConfirm('sold',opdrachtID);break;case 1:alert ("Not deleted!");break;default:document.myForm.showResult.value = "(void)";break;}}function buttonClickedVerkocht(buttonChoice,opdrachtID){switch( buttonChoice ){case 0:window.location = "/test.php?a=yes&b=" + opdrachtID;break;case 1:window.location = "/test.php?a=no&b=" + opdrachtID;break;default:document.myForm.showResult.value = "(void)";break;}}} It works fine in Chrome!!! But in IE it does not work like it should... The first window appears. When clicked "NO" then the alert shows up, but it stays behind the first window, instead of in front of it. When clicked "YES" then the first window closes, but the second window doesn't show up. So when clicked "NO", then the alert has to show up in front of the first window. When clicked "YES" the second window has to show up. Any suggestions?
  14. Got it working... thnx!!!! in php I did not use an array, but from start I uses a comma seperatored string. In Javascript I did spilt this string to an array... thnx thnx thnx
  15. okay... php file: <?php$sourceSelectValue = $_GET['a']; //volkswagen, volvo$db_sourceTable = $_GET['b']; //'merken'$db_sourceTableID = $_GET['c']; //'IDmerken'$db_sourceTableColumn = $_GET['d']; //'Merk'$db_targetTable = $_GET['e']; //'modellen'$db_targetTableColumn = $_GET['f']; //'IDmerken' echo $sourceSelectValue;echo "<br />";echo $db_sourceTable;echo "<br />";echo $db_sourceTableID;echo "<br />";echo $db_sourceTableColumn;echo "<br />";echo $db_targetTable;echo "<br />";echo "<br />"; include($_SERVER["DOCUMENT_ROOT"]."/config.php"); //Include de config met username en passwordsmysql_connect("localhost",$GLOBALS["dbuser"],$GLOBALS["dbpass"]) or die(mysql_error());mysql_select_db($GLOBALS["dbname"]); $result = mysql_query("SELECT " . $db_sourceTableID . " FROM " . $db_sourceTable . " WHERE " . $db_sourceTableColumn . " = '$sourceSelectValue'");$row= mysql_fetch_array($result); $resultModel = mysql_query("SELECT * FROM " . $db_targetTable . " WHERE " . $db_targetTableColumn . " = '$row[0]'"); $myArray = array();$x=0;while ($rowModel = mysql_fetch_array($resultModel)){echo $rowModel['model'];echo "<br />";//$options[$x]=$rowModel['model'];$myArray[] = array($rowModel['model']);//$myArray[$x] = array($rowModel['model'] => $rowModel['model']);//$myarray[$x] = $rowModel['model'];//$rene = $rowmodel['model'];$x = $x + 1;}echo "<br />";echo "<br />";echo "array1: " . $myArray;echo "<br />";echo "<br />";print_r($myArray);echo "<br />";echo "<br />";echo "frst: " . $myArray[0];echo "<br />";echo "scnd: " . $myArray[1];echo "<br />";echo "thrd: " . $myArray[2]; ?> Show this in browser: abarthmerkenid_merkenmerkmodellen500500cPunto Evoarray1: ArrayArray ( [0] => Array ( [0] => 500 ) [1] => Array ( [0] => 500c ) [2] => Array ( [0] => Punto Evo ) ) frst: Arrayscnd: Arraythrd: Array So the array has been made, but what now? I want to "echo" or "return" this array to my javascript funtion and use it there, but can't get it accomplished.... I just get the value "Array", but not the content...
  16. I see there is missing some info in my post, I had typed more stuff underneath the last code section for explanation... I will try your option, to see what's happening in the php-file later on. I come back to this.
  17. Next problem I can;t get right: Javascript function: function fillSelect(sourceSelectID, targetSelectID, db_sourceTable, db_sourceTableID, db_sourceTableColumn, db_targetTable, db_targetTableColumn){//clear the selectvar selectObj = document.getElementById(targetSelectID);var selectParentNode = selectObj.parentNode;var newSelectObj = selectObj.cloneNode(false);selectParentNode.replaceChild(newSelectObj, selectObj); var sourceSelectValue = document.getElementById(sourceSelectID).value;run_xmlhttp();xmlhttp.onreadystatechange=function() {if (xmlhttp.readyState==4 && xmlhttp.status==200) {//alert (xmlhttp.responseText);alert(JSON.stringify(xmlhttp.responseText));//arraySelector = xmlhttp.responseText;//alert ("eerste: " + arraySelector);//alert ("tweede: " + arraySelector[1]);//alert("derde: " + arraySelector.join('n')) //document.getElementById(targetSelectID).innerHTML=xmlhttp.responseText;//myFunction(xmlhttp.responseText,targetSelectID); //var selectArray = xmlhttp.responseText; //var sel = document.getElementById(targetSelectID);//for(var i = 0; i < selectArray.length; i++){// var opt = document.createElement('option');// opt.innerHTML = selectArray[i];// opt.value = selectArray[i];// sel.appendChild(opt);//}}}xmlhttp.open('GET', '/secure/opdrachten/db_fillSelect.php?a=' + sourceSelectValue + '&b=' + db_sourceTable + '&c=' + db_sourceTableID + '&d=' + db_sourceTableColumn + '&e=' + db_targetTable + '&f=' + db_targetTableColumn, true);xmlhttp.send();} The db_fillSelect.php file: <?php$myArray = array();$x=0;while ($rowmodel = mysql_fetch_array($resultmodel)){//$options[$x]=$rowmodel['model'];//$myArray[] = array($rowmodel['model']);//$myArray[$x] = array($rowmodel['model'] => $rowmodel['model']);$myarray[$x] = $rowmodel['model'];//$rene = $rowmodel['model'];$x = $x + 1;}//echo $myArray;return $myArray;//echo $rene;?>
  18. Thanks! I develop using Chrome... and from now on I go test it more often on other browsers too! lol
  19. The problem is, that I first made my website run in Chrome... after finishing that, I am testing it on the other browsers and fix the bugs for the browsers. How you al do this? Build for one browser first (maybe IE, cause there are the most problems) or are you all testing the different browsers while writing the code?
  20. Thanks for your replies.... I go work with it again
  21. I changed the ">>" after last to ">", but still not working. Also tried "><", but also not working. The select still not filled... Does this part sounds okay? I guess there has to be an error? var newdiv = document.createElement("div");newdiv.innerHTML = options;alert (newdiv.innerHTML);alert (selectBox2);var container = document.getElementById(selectBox2);container.appendChild(newdiv);
  22. A quick response, before I go offline.... (I be back on this tomorrow) This is the code of the whole function: (selectBox2 contains the ID of the second select, which needs to be filled depending on the choice made in the first select. Hope it makes sense to you all function selectBox(selectBox1,selectBox2,checkAllSelected_YesNo,buttonID,buttonClassID,AddChange){function toArray(obj) {var array = [];for (var i = obj.length >>> 0; i-- { array[i] = obj[i];}return array;}function addCommas(nStr){nStr += '';var x = nStr.split('.');var x1 = x[0];var x2 = x.length > 1 ? '.' + x[1] : '';var rgx = /(d+)(d{3})/;while (rgx.test(x1)) {x1 = x1.replace(rgx, '$1' + '.' + '$2');}return x1 + x2;}firstSelect = document.getElementById(selectBox1).getElementsByTagName('option');secondSelect = toArray(firstSelect);select1 = document.getElementById(selectBox1).value;var currentTime = new Date()//alert(select1);if (select1=='empty'){document.getElementById(selectBox2).disabled = 1;document.getElementById(selectBox2).innerHTML = '<option value="empty">tot</option>';//document.getElementById('hidden_selectPrijs2').value = document.getElementById(selectBox2).value;if (AddChange == 'add'){checkAllSelected_add_change_DB(buttonID,buttonClassID);}if (AddChange == 'change'){checkAllSelected_change_DB(buttonID,buttonClassID);}return;}if (select1=='last'){document.getElementById(selectBox2).disabled = 1;document.getElementById(selectBox2).innerHTML = '<option value="0">n.v.t.</option>';//document.getElementById('hidden_selectPrijs2').value = document.getElementById(selectBox2).value;if (AddChange == 'add'){checkAllSelected_add_change_DB(buttonID,buttonClassID);}if (AddChange == 'change'){checkAllSelected_change_DB(buttonID,buttonClassID);}return;}//alert(select1);var i = 0;var a = "eerste";for(var i in secondSelect){if (secondSelect[i].value=='empty'){options = "";}if (parseInt(secondSelect[i].value)>=parseInt(select1)){if (selectBox1=='selectBouwjaar1'){if (a != "eerste"){options = options + "<option value='" + secondSelect[i].value + "'>" + secondSelect[i].value + "</option>";}var a = "rest";}if (selectBox1=='selectKilometerstand1'){if (a != "eerste"){options = options + "<option value='" + secondSelect[i].value + "'>" + addCommas(secondSelect[i].value) + "</option>";}var a = "rest";}if (selectBox1=='selectPrijs1'){if (a != "eerste"){options = options + "<option value='" + secondSelect[i].value + "'>" + addCommas(secondSelect[i].value) + ",-</option>";}var a = "rest";}if (selectBox1=='selectVermogen1'){if (a != "eerste"){options = options + "<option value='" + secondSelect[i].value + "'>" + addCommas(secondSelect[i].value) + "</option>";}var a = "rest";}}if (secondSelect[i].value=='last'){if (selectBox1=='selectBouwjaar1'){options = options + "<option value='last'>" + currentTime.getFullYear() + "</option>";}if (selectBox1=='selectKilometerstand1'){options = options + "<option value='last'>>300.000</option>";}if (selectBox1=='selectPrijs1'){options = options + "<option value='last'>>250.000</option>";}if (selectBox1=='selectVermogen1'){options = options + "<option value='last'>>1.000</option>";}}} var newdiv = document.createElement("div");newdiv.innerHTML = options;alert (newdiv.innerHTML);var container = document.getElementById(selectBox2);container.appendChild(newdiv);//document.getElementById(selectBox2).innerHTML = options;//document.getElementById(selectBox2).disabled=false; if(checkAllSelected_YesNo=='ja'){if (AddChange == 'add'){checkAllSelected_add_change_DB(buttonID,buttonClassID);}if (AddChange == 'change'){checkAllSelected_change_DB(buttonID,buttonClassID);}}}
  23. Hi all, I am writing some code. It works in Chrome, but not in IE. I have a variable options which contains the options of a select. This code works okay in Chrome: document.getElementById(selectBox2).innerHTML = options; But in IE the select is not filled. I read numerous articles, but can't get it right... this is what I have, but does not work. var newdiv = document.createElement("div");newdiv.innerHTML = options;alert (newdiv.innerHTML);var container = document.getElementById(selectBox2);container.appendChild(newdiv); The alert, does give the right values, but I can't get them in the select. Any suggestions?
×
×
  • Create New...