adservio
Members-
Posts
23 -
Joined
-
Last visited
adservio's Achievements
Newbie (1/7)
0
Reputation
-
You may need to post more of your source code.Here's something that might help you spot your problem.Tested in IE, O, FF. <script type="text/javascript"> var test = 'test'; var i = 5; var j = 6 function showThis(s, int) { alert(s + ' ' + int); } function chgOnChange(id) { document.getElementById(id).onchange = function() { showThis(test, j - i); }; } </script> </head> <body> <input type="text" id="t1" value="test this" /> <script type="text/javascript">chgOnChange('t1');</script>
-
You have a broken height attribute in your outter table.Also I would suggest moving your form tags out of the table. function displayPopUp(event) { var fromTop = event.clientY; var promptWidth = 400; var fromLeft = ((screen.width - promptWidth) / 2) - 21; if(!document.getElementById("prompt")) { var promptBox = document.createElement('div'); promptBox.id = 'prompt'; } else { var promptBox = document.getElementById('prompt'); } if(!document.getElementById("prompt")) document.body.appendChild(promptBox); promptBox.style.width = promptWidth; //promptBox.style.height = '300'; promptBox.style.backgroundColor = '#ffffff'; promptBox.style.border = '1px solid #476B8A'; promptBox.style.fontFamily = 'arial'; promptBox.style.fontSize = '10pt'; promptBox.style.position = 'absolute'; promptBox.style.top = fromTop; promptBox.style.left = fromLeft; promptBox.style.padding = '1px'; promptBox.innerHTML = '<form><table width="100%" border="0" cellpadding="0" cellspacing="0">\n' +'<tr>\n' +' <td width="93%" height="26" bgcolor="#6589A7"> <b>Send Email</b></td>\n' +' <td width="7%" height="26" bgcolor="#6589A7" style="padding:3px;">\n' +' <center><img src="close.gif" style="cursor:pointer;" onClick="closePopUp();" alt="Close Email Form" /></center>\n' +' </td>\n' +'</tr>\n' +'<tr>\n' +' <td colspan="2">\n' +' <div style="overflow:auto;padding:1px;background-color:#FEFFFF;" id="popup">\n' +' <table width="100%" border="0" cellpadding="5" cellspacing="0">\n' +' <tr>\n' +' <td width="50%">Your name:</td>\n' +' <td width="50%"><input type="text" id="eName" /></td>\n' +' </tr>\n' +' <tr>\n' +' <td width="50%">Your email:</td>\n' +' <td width="50%"><input type="text" id="eEmail" /></td>\n' +' </tr>\n' +' <tr>\n' +' <td width="50%">Your message:</td>\n' +' <td width="50%">\n' +' <textarea id="eMessage" style="width:200px;height:40px;"></textarea></td>\n' +' </tr>\n' +' </table></div>\n' +' </td></tr><tr><td colspan="2">\n' +' <hr color="#6589A7" size="1" />\n' +' <span style="text-align:right;width:100%">\n' +' <img align="right" src="send.gif" style="cursor:pointer;" onClick="sendEmail();" /></span>\n' +' </td>\n' +' </tr>\n' +'</table></form>\n';} HTH
-
While it's not actually a "toolkit" it is a good collection. top-ten@agent moosekits and code
-
Thanks Justin, dead on with that solution. And I have found that the event passes properly when using your method, give me a second and I will fix my post.Thanks to both,
-
With aspnetguy's help below(next post): <div id="p" class="parent"><div id="a" class="header">Testing Stuff Here</div><div id="b" class="header">Testing Stuff Here</div><div id="c" class="header">Testing Stuff Here</div></div><script type="text/javascript">///////////////////////////////// Organic.Tree.Menu //// Made by Chocolate570 //// Current Version Details //// [0.1 Beta] ///////////////////////////////////Start Menufunction testThis(e) { var targ; if (!e) var e = window.event; if (e.target) targ = e.target; else if (e.srcElement) targ = e.srcElement; if (targ.nodeType == 3) // defeat Safari bug targ = targ.parentNode;alert(targ.id); }//////////Attribute Setter//////////divHl=document.getElementsByTagName("div");for(i=0;i<divHl.length;i++) {if(divHl[i].className=="parent") {inDiv=divHl[i].getElementsByTagName("div");for(j=0;j<inDiv.length;j++) {if(inDiv[j].className=="header") {heHl=inDiv[j];heHl.onclick = testThis;} } } }////////////////////////////////////</script> Tested in IE, FF O
-
Here's an idea that might get you started: function padThis(n) {// next line converts n to string in case you pass it an integern += '';var charArray = n.split('');var temp = '';var cycles = charArray.length; while(temp.length < 13) { if(temp.length == 5 || temp.length == 11) { temp = '-' + temp; continue; } if(cycles == 0) { temp = '0' + temp; } else { temp = charArray[--cycles] + temp; } }alert(temp);}padThis(456);padThis('234567'); HTH
-
You can use ksort to sort the $_REQUEST array: ksort($_REQUEST); foreach($_REQUEST as $k=>$value) { if(is_array($value)) { foreach($value as $v) $mail_body .= "$k: $v\n"; } else $mail_body .= "$k: $value\n"; }
-
How about a global array..that way your calls are distinct. var count = 0; var cmd = new Array(); function doSomething( parameterOne ) { count++; alert ( "parameterOne = " + parameterOne ); cmd[count] = parameterOne + count; if(count > 6) return; setTimeout( 'doSomething(cmd[' + count +'])', 2000 ); } doSomething ( "first" ); doSomething ( "next" ); doSomething ( "last" );
-
You can pass a global varaiable, maybe this will help. var count = 0; var cmd; function doSomething( parameterOne ){ alert ( "parameterOne = " + parameterOne ); cmd = parameterOne + count++; setTimeout( 'doSomething(cmd)', 2000 );}doSomething ( "hello" ); Or pass a literal string. var count = 0; function doSomething( parameterOne ){ alert ( "parameterOne = " + parameterOne ); str = parameterOne + count++; setTimeout( 'doSomething("' + str + '")', 2000 );}doSomething ( "hello" ); HTH
-
Try the "ungreedy" modifier. $re = '/\w+\s*=\s*("|\')?[^\1]+\1/U'; http://us2.php.net/manual/en/reference.pcr...n.modifiers.php
-
It's a new MS strategy....It will take them to 2033 to get the bugs out.
-
Me to0o0, you got off in the deep water Here's something that might help you.haacked.comThen you have to consider those nested tags. :)EDIT:One thing I can recommend is to make the patterns include newlines:<?php$html ="<FRAMEsrc='test.html'></FRAME>";$re = "/<(frame)(.*)><\/\\1>/is";echo preg_match($re, $html, $matches);print_r($matches);?>
-
How about using the "i" pattern mod for ignore case and escaping the \ in \1. <?php$html ="<FRAME src='test.html'></FRAME>";$re = "/<(frame)(.*)><\/\\1>/i";echo preg_match($re, $html, $matches);print_r($matches);?> HTH
-
Are you sure you are using number_format correctly? <?php$x = 1233.2;echo number_format( $x, 3, '.', ',');?> This should give you 3 decimal places.