Duplicate a row using javascript 
function addNonPhysicianRow() {

var nonpTbl = document.getElementById('NPTbl');
var trs = nonpTbl.getElementsByTagName('tr');
var len = trs.length - 1;
var lastRow = trs[len];
var newRow = lastRow.cloneNode(true);
var tds = newRow.getElementsByTagName('td');
var currLen = len - 3;
currLen++;
for (var i=0; i < tds.length; i++) {
var td = tds;
if (i == 0) {
td.innerHTML = td.innerHTML.replace(/Third /, "");
}
var input = (td.getElementsByTagName('input'))[0];
var currName;
if (input) {
currName = input.name;
var new_name = currName.replace(/NNP_\d_(.*)/, "NNP_" + currLen + "_$1");
input.name = new_name;
}
var sel = (td.getElementsByTagName('select'))[0];
if (sel) {
currName = sel.name;
var new_name = currName.replace(/NNP_\d_(.*)/, "NNP_" + currLen + "_$1");
sel.name = new_name;
}

}
nonpTbl.appendChild(newRow);
var val = parseInt(document.getElementById('totalNonPhysician').value);
val++;
document.getElementById('totalNonPhysician').value = val;
//alert('val = ' + val + ' - ' + document.getElementById('totalNonPhysician').value);
return false;
}

[ add comment ] ( 3 views )   |  permalink  |   ( 3.1 / 28 )
CS1010: Newline in Constant" Error Message - fixed 
CS1010: Newline in Constant" Error Message

I got this error from asp.net application and here is the solution

Modify string as like

string strValue = "Test value";
string strAll = "<SCRIPT lanquage='JScript'>window.alert('" + strValue + "');<"+"/SCRIPT>";
More..
http://support.microsoft.com/default.as ... -US;827420

"This behavior is by design"

Why??

because the compiler things that the </SCRIPT> in strAll is the closing tag for the <script runat="server">
=========
<script runat="server">
private void Page_Load(object sender, System.EventArgs e)
{
string strValue = "Test value";
string strAll = "<SCRIPT lanquage='JScript'>window.alert('" + strValue + "');</SCRIPT>";

http://weblogs.asp.net/sbehera/archive/ ... 27228.aspx

[ add comment ]   |  permalink  |  related link  |   ( 2.9 / 29 )
iPhone Screen Orientation: Portrait and Landscape 
http://www.evotech.net/blog/2009/09/iph ... landscape/

[ add comment ] ( 1 view )   |  permalink  |   ( 3 / 75 )
Private Messaging System  
http://www.pixel2life.com/publish/tutor ... ng_system/

[ add comment ]   |  permalink  |   ( 3 / 103 )
Page layout Ideas/JS/Flash 
This is a living article and contains urls which I find interesting and Might incorporate one day into something.


1. http://www.marriott.com/default.mi


[ add comment ] ( 2 views )   |  permalink  |   ( 2.8 / 65 )
php quote in mysql like perl 
mysql_real_escape_string()

<?php
// Connect
$link = mysql_connect('mysql_host', 'mysql_user', 'mysql_password')
OR die(mysql_error());

// Query
$query = sprintf("SELECT * FROM users WHERE user='%s' AND password='%s'",
mysql_real_escape_string($user),
mysql_real_escape_string($password));
?>

[ add comment ] ( 3 views )   |  permalink  |  related link  |   ( 3.1 / 88 )
After Registration Email 
$content = "
<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'
'http://www.w3.org/TR/html4/loose.dtd'>
<html>
<head>
<title>TotalESL</title>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>
</head>

<body>

<table width='600' border='0' cellspacing='2' cellpadding='2'>
<tr>
<td align='left' class='textbig'><strong>Dear ".$username.":</strong><br><br>
Thank you for joining TotalESL.com, First Stop for Your Second Language Needs. <br>Please note your account information <br />
<br />
<table width='100%' border='0' cellspacing='2' cellpadding='2'>
<tr valign='top'>
<td width='140' align='left' class='text'> <strong>Username:</strong></td>
<td align='left' class='text'>".$username."</td>
</tr>
<tr valign='top'>
<td align='left' class='text'><strong>Password:</strong></td>
<td align='left' class='text'>".$password."</td>
</tr>
<tr valign='top'>
<td align='left' class='text'><strong>IM/Chat Username:</strong></td>
<td align='left' class='text'>".$username."</td>
</tr>
</table>
<br></td>
</tr>
<tr>
<td class='text' align='left'>Congratulations! You may to proceed and use our member features:<br>
</td>
</tr>
<tr>
<td class='text' align='left'>&nbsp;</td>
</tr>
<tr>
<td class='text' align='left'>Thank you.
<br />
<br />
Admin
<br />
TotalESL.com <a href='http://www.totalesl.com'><br />
http://www.totalesl.com</a></td>
</tr>
</table>
<br>

</body>
</html>";

[ 1 comment ] ( 12 views )   |  permalink  |   ( 3 / 87 )
PHP Sending Mail 
Code below works without errors
<?php

$Name = "Da Duder"; //senders name
$email = "email@adress.com"; //senders e-mail adress
$recipient = "PersonWhoGetsIt@emailadress.com"; //recipient
$mail_body = "The text for the mail..."; //mail body
$subject = "Subject for reviever"; //subject
$header = "From: ". $Name . " <" . $email . ">\r\n"; //optional headerfields

mail($recipient, $subject, $mail_body, $header); //mail command :)
?>

[ add comment ] ( 7 views )   |  permalink  |  related link  |   ( 2.9 / 76 )
PHP random password generator 
<?php

function generatePassword($length=9, $strength=0) {
$vowels = 'aeuy';
$consonants = 'bdghjmnpqrstvz';
if ($strength & 1) {
$consonants .= 'BDGHJLMNPQRSTVWXZ';
}
if ($strength & 2) {
$vowels .= "AEUY";
}
if ($strength & 4) {
$consonants .= '23456789';
}
if ($strength & 8) {
$consonants .= '@#$%';
}

$password = '';
$alt = time() % 2;
for ($i = 0; $i < $length; $i++) {
if ($alt == 1) {
$password .= $consonants[(rand() % strlen($consonants))];
$alt = 0;
} else {
$password .= $vowels[(rand() % strlen($vowels))];
$alt = 1;
}
}
return $password;
}

?>

[ add comment ] ( 1 view )   |  permalink  |  related link  |   ( 3 / 68 )
PERL OOP - Destructors  
If constructors can have arbitrary names, then why not destructors? Because while a constructor is explicitly called, a destructor is not. Destruction happens automatically via Perl's garbage collection (GC) system, which is a quick but somewhat lazy reference-based GC system. To know what to call, Perl insists that the destructor be named DESTROY. Perl's notion of the right time to call a destructor is not well-defined currently, which is why your destructors should not rely on when they are called.

Why is DESTROY in all caps? Perl on occasion uses purely uppercase function names as a convention to indicate that the function will be automatically called by Perl in some way. Others that are called implicitly include BEGIN, END, AUTOLOAD, plus all methods used by tied objects, described in the perltie manpage.

[ add comment ]   |  permalink  |   ( 3 / 62 )

<<First <Back | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Next> Last>>