Jump to content

adservio

Members
  • Posts

    23
  • Joined

  • Last visited

Posts posted by adservio

  1. 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>

  2. 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

  3. 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,

  4. 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

  5. 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

  6. 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"; }

  7. 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" );

  8. 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

  9. Still Make my Brain Hurt
    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);?>

  10. 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

  11. Set up an array with valid values and test the input:

    $allowed = array('do' => array('openstatistics','showlinks'));foreach($_GET as $k=>$v){    if(!in_array($v, $allowed[$k])){      // reset to a default value      $_GET[$k] = $allowed[$k][0];    }}

    Maybe this will help. :)

  12. You can assign a class by using className:

    <style type="text/css">.no_tint {  background-color: #fff;}.tint {  background-color: #6ff;}</style><script type="text/javascript">var i = 0;function insRow(){var c;((++i) % 2 == 0 )? c = 'no_tint' : c = 'tint'; var x=document.getElementById('myTable').insertRow(0);x.className = c;var y=x.insertCell(0);var z=x.insertCell(1);y.innerHTML="NEW CELL1";z.innerHTML="NEW CELL2";}</script>

    Used with this page.

  13. You and Scott have the right ingredients we just need to mix them differently.

      function doThat(func, whom) {  var str = func(whom);  var temp = func.toString();  temp = temp.substring(9, temp.indexOf("("));  alert(str + ' was a result of the function '+ temp);  }

    The question is.. would it be easier to just pass another argument as a string representing the function?Glad the other post worked out for you. :)

  14. I believe it will pass OK as an argument:

      <script type="text/javascript">  function sayHello(who) {  return 'Hello ' + who;  }  function sayGoodbye(who){  return 'Goodbye ' + who;  }  function doThat(func, whom) {  var str = func(whom);  alert(str);  }  doThat(sayHello, 'Bob');  doThat(sayGoodbye, 'Bob');  </script>

    Is that what you are looking to do?

×
×
  • Create New...