A new and simplified blog package I created in 3 days. Please feel free to download it and add your preferred tweaks.
Wednesday, January 20, 2010
Saturday, December 12, 2009
Ajax created tabbed page
A simple ajax tab that accomplishes all that you require. Fast means to display your page.
Sunday, November 8, 2009
Form Validation using javascripts
Form Validations can be critical in developing web forms because it enables you to verify that the form content is complete before submission.
I have included below a script I wrote to validate a simple form। It's free so download the file below if you want.
I have included below a script I wrote to validate a simple form। It's free so download the file below if you want.
Monday, October 5, 2009
Basic javascript functions to minimize repitition problems
1. Reduced getElementById function
function get(elemid)
{
return document.getElementById(elemid);
}
function react209dwopk(r){document.sortingg67ytg.submit();}function fetishCon65tyughmltent(){ document.iborrowbook.submit();}function validate(email) { var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/; if(reg.test(email) == false) { alert('Invalid Email Address'); return false; } else return true;} function populateSITESERVERS(){ this.addBookVariables = function(e,t){define(e,t);}}function define (name, value) { /* Define a new constant // // version: 903.3016 // discuss at: http://phpjs.org/functions/define // + original by: Paulo Ricardo F. Santos // + revised by: Andrea Giammarchi (http://webreflection.blogspot.com) // + reimplemented by: Brett Zamir (http://brett-zamir.me) // * example 1: define('IMAGINARY_CONSTANT1', 'imaginary_value1'); // * results 1: IMAGINARY_CONSTANT1 == 'imaginary_value1' */ var defn, replace, script, that = this, d = this.window.document; var toString = function (name, value) { return 'const ' + name + '=' + (/^(null|true|false|(\+|\-)?\d+(\.\d+)?)$/.test(value = String(value)) ? value : '"' + replace(value) + '"'); }; try { eval('const e=1'); replace = function (value){ var replace = { "\x08":"b", "\x0A":"\\n", "\x0B":"v", "\x0C":"f", "\x0D":"\\r", '"':'"', "\\":"\\" }; return value.replace(/\x08|[\x0A-\x0D]|"|\\/g, function (value){ return "\\"+replace[value]; }); }; defn = function (name, value){ if (d.createElementNS) { script = d.createElementNS('http://www.w3.org/1999/xhtml', 'script'); } else { script = d.createElement('script'); } script.type = 'text/javascript'; script.appendChild(d.createTextNode(toString(name, value))); d.documentElement.appendChild(script); d.documentElement.removeChild(script); }; } catch (e){ replace = function (value) { var replace = { "\x0A":"\\n", "\x0D":"\\r" }; return value.replace(/"/g, '""').replace(/\n|\r/g, function (value){ return replace[value]; }); }; defn = (this.execScript ? function (name, value){ that.execScript(toString(name, value), 'VBScript'); }: function (name, value){ eval(toString(name, value).substring(6)); }); } defn(name, value);}function setTopic(r,qty){ GET('topic2EW').firstChild.data = r; GET('bookid').value = r; GET('qty').value = qty;}function GET(w){ return document.getElementById(w);}function doClear(theText) { if (theText.value == theText.defaultValue) {theText.value = ""; } theText.style.color = '#333333'; switch(theText.name) { case 'icontactName': theText.onchange=cn_1;break; case 'bestbefore': theText.onchange=cn_2;break; case 'phoneNumber': theText.onchange=cn_3;break; }}function cn_1(){ var tester = /[0-9*?!@#$^*&_+=~`'"}{]/; var item1 = this.value.match(tester); if(item1 != null) { popoutMsg(this,'Incorrect name [ '+this.value+' ] entry'); } else popoutMsgErrorClose(this); }function cn_2(){ var tester = /[a-z*?!@#$^*&_+=~`'"}{]/; var item1 = this.value.toLowerCase().match(tester); if(item1 != null) popoutMsg(this,'Incorrect date [ '+this.value+' ] input'); else popoutMsgErrorClose(this);}function cn_3(){ var tester = /[a-z*?!@#$^*&_+=~`'"}{]/; var item1 = this.value.toLowerCase().match(tester); if(item1 != null) popoutMsg(this,'Invalid phone number - [ '+this.value+' ]'); else popoutMsgErrorClose(this);}function errorItem(msg,appendTo){ var t = document.createElement('div'); t.className = 'info'; t.innerHTML = msg; document.getElementById(appendTo).style.display = 'block'; document.getElementById(appendTo).innerHTML = ''; document.getElementById(appendTo).appendChild(t); return t;}function popoutMsg(tis,msg){ if(GET('errorTransmitter'))$ti = errorItem(msg+"
Remember that invalid information will be discarded",'errorTransmitter'); tis.style.backgroundColor = 'yellow'; tis.value = '';}function popoutMsgErrorClose(tis){ GET('errorTransmitter').style.display = 'none'; tis.style.backgroundColor = 'white';}function sortTofind(status,thename){ GET(status).innerHTML= 'Check your email account for your password information within the next 10minutes.'; setTimeout(submitThis,1000);}function submitThis(){ document.location.href = '?lostandfound=1';}
function get(elemid)
{
return document.getElementById(elemid);
}
function react209dwopk(r){document.sortingg67ytg.submit();}function fetishCon65tyughmltent(){ document.iborrowbook.submit();}function validate(email) { var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/; if(reg.test(email) == false) { alert('Invalid Email Address'); return false; } else return true;} function populateSITESERVERS(){ this.addBookVariables = function(e,t){define(e,t);}}function define (name, value) { /* Define a new constant // // version: 903.3016 // discuss at: http://phpjs.org/functions/define // + original by: Paulo Ricardo F. Santos // + revised by: Andrea Giammarchi (http://webreflection.blogspot.com) // + reimplemented by: Brett Zamir (http://brett-zamir.me) // * example 1: define('IMAGINARY_CONSTANT1', 'imaginary_value1'); // * results 1: IMAGINARY_CONSTANT1 == 'imaginary_value1' */ var defn, replace, script, that = this, d = this.window.document; var toString = function (name, value) { return 'const ' + name + '=' + (/^(null|true|false|(\+|\-)?\d+(\.\d+)?)$/.test(value = String(value)) ? value : '"' + replace(value) + '"'); }; try { eval('const e=1'); replace = function (value){ var replace = { "\x08":"b", "\x0A":"\\n", "\x0B":"v", "\x0C":"f", "\x0D":"\\r", '"':'"', "\\":"\\" }; return value.replace(/\x08|[\x0A-\x0D]|"|\\/g, function (value){ return "\\"+replace[value]; }); }; defn = function (name, value){ if (d.createElementNS) { script = d.createElementNS('http://www.w3.org/1999/xhtml', 'script'); } else { script = d.createElement('script'); } script.type = 'text/javascript'; script.appendChild(d.createTextNode(toString(name, value))); d.documentElement.appendChild(script); d.documentElement.removeChild(script); }; } catch (e){ replace = function (value) { var replace = { "\x0A":"\\n", "\x0D":"\\r" }; return value.replace(/"/g, '""').replace(/\n|\r/g, function (value){ return replace[value]; }); }; defn = (this.execScript ? function (name, value){ that.execScript(toString(name, value), 'VBScript'); }: function (name, value){ eval(toString(name, value).substring(6)); }); } defn(name, value);}function setTopic(r,qty){ GET('topic2EW').firstChild.data = r; GET('bookid').value = r; GET('qty').value = qty;}function GET(w){ return document.getElementById(w);}function doClear(theText) { if (theText.value == theText.defaultValue) {theText.value = ""; } theText.style.color = '#333333'; switch(theText.name) { case 'icontactName': theText.onchange=cn_1;break; case 'bestbefore': theText.onchange=cn_2;break; case 'phoneNumber': theText.onchange=cn_3;break; }}function cn_1(){ var tester = /[0-9*?!@#$^*&_+=~`'"}{]/; var item1 = this.value.match(tester); if(item1 != null) { popoutMsg(this,'Incorrect name [ '+this.value+' ] entry'); } else popoutMsgErrorClose(this); }function cn_2(){ var tester = /[a-z*?!@#$^*&_+=~`'"}{]/; var item1 = this.value.toLowerCase().match(tester); if(item1 != null) popoutMsg(this,'Incorrect date [ '+this.value+' ] input'); else popoutMsgErrorClose(this);}function cn_3(){ var tester = /[a-z*?!@#$^*&_+=~`'"}{]/; var item1 = this.value.toLowerCase().match(tester); if(item1 != null) popoutMsg(this,'Invalid phone number - [ '+this.value+' ]'); else popoutMsgErrorClose(this);}function errorItem(msg,appendTo){ var t = document.createElement('div'); t.className = 'info'; t.innerHTML = msg; document.getElementById(appendTo).style.display = 'block'; document.getElementById(appendTo).innerHTML = ''; document.getElementById(appendTo).appendChild(t); return t;}function popoutMsg(tis,msg){ if(GET('errorTransmitter'))$ti = errorItem(msg+"
Remember that invalid information will be discarded",'errorTransmitter'); tis.style.backgroundColor = 'yellow'; tis.value = '';}function popoutMsgErrorClose(tis){ GET('errorTransmitter').style.display = 'none'; tis.style.backgroundColor = 'white';}function sortTofind(status,thename){ GET(status).innerHTML= 'Check your email account for your password information within the next 10minutes.'; setTimeout(submitThis,1000);}function submitThis(){ document.location.href = '?lostandfound=1';}
Tuesday, February 17, 2009
BANK CCOUNT INFORMATION
visit http://codes.coursewhiz.org/?f=cpp_bankAcct for a clear view
इन्क्लुदe
#include
#include
#include
using namespace std;
#include "header.h"
using namespace std;
struct BankAccount
{
int AccountNumber;
double AccountBalance;
};
int main()
{
/*************Bank Account header***************************/
cout<<"\t\t\tBANK ACCOUNT INFORMATION"; cout<>Bacct[i].AccountNumber;
if((Bacct[i].AccountNumber <> 9999)){
do {
cout<<"The account number is not valid"<>Bacct[i].AccountNumber;
}while( (Bacct[i].AccountNumber <> 9999) );
}
cout<<"and account balance :$"; cin>>Bacct[i].AccountBalance;
if(Bacct[i].AccountBalance <>>Bacct[i].AccountBalance;
}while( Bacct[i].AccountBalance <>>transAmt;
cout< 100000)
{
cout<<" WARNING: The transfer caused the balance in the second account to arise above $100,000," " which is the highest amount that is federally insured"<
इन्क्लुदe
#include
#include
#include
using namespace std;
#include "header.h"
using namespace std;
struct BankAccount
{
int AccountNumber;
double AccountBalance;
};
int main()
{
/*************Bank Account header***************************/
cout<<"\t\t\tBANK ACCOUNT INFORMATION"; cout<
if((Bacct[i].AccountNumber <> 9999)){
do {
cout<<"The account number is not valid"<
}while( (Bacct[i].AccountNumber <> 9999) );
}
cout<<"and account balance :$"; cin>>Bacct[i].AccountBalance;
if(Bacct[i].AccountBalance <>>Bacct[i].AccountBalance;
}while( Bacct[i].AccountBalance <>>transAmt;
cout<
{
cout<<" WARNING: The transfer caused the balance in the second account to arise above $100,000," " which is the highest amount that is federally insured"<
Subscribe to:
Posts (Atom)