jspimen
Messages postés40Date d'inscriptionjeudi 17 avril 2008StatutMembreDernière intervention24 novembre 2010
-
7 juin 2008 à 13:09
Twinuts
Messages postés5375Date d'inscriptiondimanche 4 mai 2003StatutModérateurDernière intervention14 juin 2023
-
9 juin 2008 à 09:57
bonjour;
voici mon code qui permet d'ajouter des données dans une base Mysql
<script LANGUAGE="JavaScript" TYPE="text/javascript">
function isBlank(val){
if(val==null){return true;}
for(var i=0;i<val.length;i++) {
if ((val.charAt(i)==' ')||(val.charAt(i)=="\t")||(val.charAt(i)=="\n")||(val.charAt(i)=="\r")){return true;}
}
return false;
}
function isBeginBlank(val){
if(val==null){return true;}
if ((val.charAt(0)!=' ')&&(val.charAt(0)!="\t")&&(val.charAt(0)!="\n")&&(val.charAt(0)!="\r")){ return false;}
return true;
}
function isInteger(s)
{ var i;
for (i = 0; i < s.length; i++)
{
// Check that current character is number.
var c = s.charAt(i);
if (((c < "0") || (c > "9"))) return false;
}
// All characters are numbers.
return true;
}
function check() {
if (document.F.IDTA.value == "" || isBlank(document.F.IDTA.value) || document.F.IDTA.value.length >55 ) {
alert("Identifiant obligatoire et ne doit pas contenir des blancs.\n");
document.F.IDTA.focus();
return false;
}else{
if(document.F.Password.value == "" || isBlank(document.F.Password.value) || document.F.Password.value.length >55 ){
alert("Mot de passe obligatoire et ne doit pas contenir des blancs.\n");
document.F.Password.focus();
return false;
}else{
if(document.F.Nom.value == "" || isBeginBlank(document.F.Nom.value) || document.F.Nom.value.length >55){
alert("Nom obligatoire et ne doit pas commencer par des blancs.\n");
document.F.Nom.focus();
return false;
}else{
if(document.F.CIN.value.length < 8 || document.F.CIN.value.length >12 || ! isInteger(document.F.CIN.value)|| isBeginBlank(document.F.CIN.value) ){
alert("Numéro CIN est incorrecte ou trop long.\n");
document.F.CIN.focus();
return false;
}else{
if(NoOnIsChecked()){
alert("Un profil doit etre montionné.\n");
document.F.ProfilTA.focus();
document.F.ProfilAD.focus();
document.F.ProfilSUP.focus();
return false;
}
}
}
}
}
return true;
}
</script></head>
<script LANGUAGE="JavaScript" TYPE="text/javascript">
function isBlank(val){
if(val==null){return true;}
for(var i=0;i<val.length;i++) {
if ((val.charAt(i)==' ')||(val.charAt(i)=="\t")||(val.charAt(i)=="\n")||(val.charAt(i)=="\r")){return true;}
}
return false;
}
function isBeginBlank(val){
if(val==null){return true;}
if ((val.charAt(0)!=' ')&&(val.charAt(0)!="\t")&&(val.charAt(0)!="\n")&&(val.charAt(0)!="\r")){ return false;}
return true;
}
function isInteger(s)
{ var i;
for (i = 0; i < s.length; i++)
{
// Check that current character is number.
var c = s.charAt(i);
if (((c < "0") || (c > "9"))) return false;
}
// All characters are numbers.
return true;
}
function check() {
if (document.F.IDTA.value == "" || isBlank(document.F.IDTA.value) || document.F.IDTA.value.length >55 ) {
alert("Identifiant obligatoire et ne doit pas contenir des blancs.\n");
document.F.IDTA.focus();
return false;
}else{
if(document.F.Password.value == "" || isBlank(document.F.Password.value) || document.F.Password.value.length >55 ){
alert("Mot de passe obligatoire et ne doit pas contenir des blancs.\n");
document.F.Password.focus();
return false;
}else{
if(document.F.Nom.value == "" || isBeginBlank(document.F.Nom.value) || document.F.Nom.value.length >55){
alert("Nom obligatoire et ne doit pas commencer par des blancs.\n");
document.F.Nom.focus();
return false;
}else{
if(document.F.CIN.value.length < 8 || document.F.CIN.value.length >12 || ! isInteger(document.F.CIN.value)|| isBeginBlank(document.F.CIN.value) ){
alert("Numéro CIN est incorrecte ou trop long.\n");
document.F.CIN.focus();
return false;
}else{
if(NoOnIsChecked()){
alert("Un profil doit etre montionné.\n");
document.F.ProfilTA.focus();
document.F.ProfilAD.focus();
document.F.ProfilSUP.focus();
return false;
}
}
}
}
}
return true;
}
</script></head>
<script LANGUAGE="JavaScript" TYPE="text/javascript">
function isBlank(val){
if(val==null){return true;}
for(var i=0;i<val.length;i++) {
if ((val.charAt(i)==' ')||(val.charAt(i)=="\t")||(val.charAt(i)=="\n")||(val.charAt(i)=="\r")){return true;}
}
return false;
}
function isBeginBlank(val){
if(val==null){return true;}
if ((val.charAt(0)!=' ')&&(val.charAt(0)!="\t")&&(val.charAt(0)!="\n")&&(val.charAt(0)!="\r")){ return false;}
return true;
}
function isInteger(s)
{ var i;
for (i = 0; i < s.length; i++)
{
// Check that current character is number.
var c = s.charAt(i);
if (((c < "0") || (c > "9"))) return false;
}
// All characters are numbers.
return true;
}
function check() {
if (document.F.IDTA.value == "" || isBlank(document.F.IDTA.value) || document.F.IDTA.value.length >55 ) {
alert("Identifiant obligatoire et ne doit pas contenir des blancs.\n");
document.F.IDTA.focus();
return false;
}else{
if(document.F.Password.value == "" || isBlank(document.F.Password.value) || document.F.Password.value.length >55 ){
alert("Mot de passe obligatoire et ne doit pas contenir des blancs.\n");
document.F.Password.focus();
return false;
}else{
if(document.F.Nom.value == "" || isBeginBlank(document.F.Nom.value) || document.F.Nom.value.length >55){
alert("Nom obligatoire et ne doit pas commencer par des blancs.\n");
document.F.Nom.focus();
return false;
}else{
if(document.F.CIN.value.length < 8 || document.F.CIN.value.length >12 || ! isInteger(document.F.CIN.value)|| isBeginBlank(document.F.CIN.value) ){
alert("Numéro CIN est incorrecte ou trop long.\n");
document.F.CIN.focus();
return false;
}else{
if(NoOnIsChecked()){
alert("Un profil doit etre montionné.\n");
document.F.ProfilTA.focus();
document.F.ProfilAD.focus();
document.F.ProfilSUP.focus();
return false;
}
}
}
}
}
return true;
}
</script></head>
<script LANGUAGE="JavaScript" TYPE="text/javascript">
function isBlank(val){
if(val==null){return true;}
for(var i=0;i<val.length;i++) {
if ((val.charAt(i)==' ')||(val.charAt(i)=="\t")||(val.charAt(i)=="\n")||(val.charAt(i)=="\r")){return true;}
}
return false;
}
function isBeginBlank(val){
if(val==null){return true;}
if ((val.charAt(0)!=' ')&&(val.charAt(0)!="\t")&&(val.charAt(0)!="\n")&&(val.charAt(0)!="\r")){ return false;}
return true;
}
function isInteger(s)
{ var i;
for (i = 0; i < s.length; i++)
{
// Check that current character is number.
var c = s.charAt(i);
if (((c < "0") || (c > "9"))) return false;
}
// All characters are numbers.
return true;
}
function check() {
if (document.F.IDTA.value == "" || isBlank(document.F.IDTA.value) || document.F.IDTA.value.length >55 ) {
alert("Identifiant obligatoire et ne doit pas contenir des blancs.\n");
document.F.IDTA.focus();
return false;
}else{
if(document.F.Password.value == "" || isBlank(document.F.Password.value) || document.F.Password.value.length >55 ){
alert("Mot de passe obligatoire et ne doit pas contenir des blancs.\n");
document.F.Password.focus();
return false;
}else{
if(document.F.Nom.value == "" || isBeginBlank(document.F.Nom.value) || document.F.Nom.value.length >55){
alert("Nom obligatoire et ne doit pas commencer par des blancs.\n");
document.F.Nom.focus();
return false;
}else{
if(document.F.CIN.value.length < 8 || document.F.CIN.value.length >12 || ! isInteger(document.F.CIN.value)|| isBeginBlank(document.F.CIN.value) ){
alert("Numéro CIN est incorrecte ou trop long.\n");
document.F.CIN.focus();
return false;
}else{
if(NoOnIsChecked()){
alert("Un profil doit etre montionné.\n");
document.F.ProfilTA.focus();
document.F.ProfilAD.focus();
document.F.ProfilSUP.focus();
return false;
}
}
}
}
}
return true;
}
</script></head>
<script LANGUAGE="JavaScript" TYPE="text/javascript">
function isBlank(val){
if(val==null){return true;}
for(var i=0;i<val.length;i++) {
if ((val.charAt(i)==' ')||(val.charAt(i)=="\t")||(val.charAt(i)=="\n")||(val.charAt(i)=="\r")){return true;}
}
return false;
}
function isBeginBlank(val){
if(val==null){return true;}
if ((val.charAt(0)!=' ')&&(val.charAt(0)!="\t")&&(val.charAt(0)!="\n")&&(val.charAt(0)!="\r")){ return false;}
return true;
}
function isInteger(s)
{ var i;
for (i = 0; i < s.length; i++)
{
// Check that current character is number.
var c = s.charAt(i);
if (((c < "0") || (c > "9"))) return false;
}
// All characters are numbers.
return true;
}
function check() {
if (document.F.IDTA.value == "" || isBlank(document.F.IDTA.value) || document.F.IDTA.value.length >55 ) {
alert("Identifiant obligatoire et ne doit pas contenir des blancs.\n");
document.F.IDTA.focus();
return false;
}else{
if(document.F.Password.value == "" || isBlank(document.F.Password.value) || document.F.Password.value.length >55 ){
alert("Mot de passe obligatoire et ne doit pas contenir des blancs.\n");
document.F.Password.focus();
return false;
}else{
if(document.F.Nom.value == "" || isBeginBlank(document.F.Nom.value) || document.F.Nom.value.length >55){
alert("Nom obligatoire et ne doit pas commencer par des blancs.\n");
document.F.Nom.focus();
return false;
}else{
if(document.F.CIN.value.length < 8 || document.F.CIN.value.length >12 || ! isInteger(document.F.CIN.value)|| isBeginBlank(document.F.CIN.value) ){
alert("Numéro CIN est incorrecte ou trop long.\n");
document.F.CIN.focus();
return false;
}else{
if(NoOnIsChecked()){
alert("Un profil doit etre montionné.\n");
document.F.ProfilTA.focus();
document.F.ProfilAD.focus();
document.F.ProfilSUP.focus();
return false;
}
}
}
}
}
return true;
}
</script></head>
<script LANGUAGE="JavaScript" TYPE="text/javascript">
function isBlank(val){
if(val==null){return true;}
for(var i=0;i<val.length;i++) {
if ((val.charAt(i)==' ')||(val.charAt(i)=="\t")||(val.charAt(i)=="\n")||(val.charAt(i)=="\r")){return true;}
}
return false;
}
function isBeginBlank(val){
if(val==null){return true;}
if ((val.charAt(0)!=' ')&&(val.charAt(0)!="\t")&&(val.charAt(0)!="\n")&&(val.charAt(0)!="\r")){ return false;}
return true;
}
function isInteger(s)
{ var i;
for (i = 0; i < s.length; i++)
{
// Check that current character is number.
var c = s.charAt(i);
if (((c < "0") || (c > "9"))) return false;
}
// All characters are numbers.
return true;
}
function check() {
if (document.F.IDTA.value == "" || isBlank(document.F.IDTA.value) || document.F.IDTA.value.length >55 ) {
alert("Identifiant obligatoire et ne doit pas contenir des blancs.\n");
document.F.IDTA.focus();
return false;
}else{
if(document.F.Password.value == "" || isBlank(document.F.Password.value) || document.F.Password.value.length >55 ){
alert("Mot de passe obligatoire et ne doit pas contenir des blancs.\n");
document.F.Password.focus();
return false;
}else{
if(document.F.Nom.value == "" || isBeginBlank(document.F.Nom.value) || document.F.Nom.value.length >55){
alert("Nom obligatoire et ne doit pas commencer par des blancs.\n");
document.F.Nom.focus();
return false;
}else{
if(document.F.CIN.value.length < 8 || document.F.CIN.value.length >12 || ! isInteger(document.F.CIN.value)|| isBeginBlank(document.F.CIN.value) ){
alert("Numéro CIN est incorrecte ou trop long.\n");
document.F.CIN.focus();
return false;
}else{
if(NoOnIsChecked()){
alert("Un profil doit etre montionné.\n");
document.F.ProfilTA.focus();
document.F.ProfilAD.focus();
document.F.ProfilSUP.focus();
return false;
}
}
}
}
}
return true;
}
</script></head>
<script LANGUAGE="JavaScript" TYPE="text/javascript">
function isBlank(val){
if(val==null){return true;}
for(var i=0;i<val.length;i++) {
if ((val.charAt(i)==' ')||(val.charAt(i)=="\t")||(val.charAt(i)=="\n")||(val.charAt(i)=="\r")){return true;}
}
return false;
}
function isBeginBlank(val){
if(val==null){return true;}
if ((val.charAt(0)!=' ')&&(val.charAt(0)!="\t")&&(val.charAt(0)!="\n")&&(val.charAt(0)!="\r")){ return false;}
return true;
}
function isInteger(s)
{ var i;
for (i = 0; i < s.length; i++)
{
// Check that current character is number.
var c = s.charAt(i);
if (((c < "0") || (c > "9"))) return false;
}
// All characters are numbers.
return true;
}
function check() {
if (document.F.IDTA.value == "" || isBlank(document.F.IDTA.value) || document.F.IDTA.value.length >55 ) {
alert("Identifiant obligatoire et ne doit pas contenir des blancs.\n");
document.F.IDTA.focus();
return false;
}else{
if(document.F.Password.value == "" || isBlank(document.F.Password.value) || document.F.Password.value.length >55 ){
alert("Mot de passe obligatoire et ne doit pas contenir des blancs.\n");
document.F.Password.focus();
return false;
}else{
if(document.F.Nom.value == "" || isBeginBlank(document.F.Nom.value) || document.F.Nom.value.length >55){
alert("Nom obligatoire et ne doit pas commencer par des blancs.\n");
document.F.Nom.focus();
return false;
}else{
if(document.F.CIN.value.length < 8 || document.F.CIN.value.length >12 || ! isInteger(document.F.CIN.value)|| isBeginBlank(document.F.CIN.value) ){
alert("Numéro CIN est incorrecte ou trop long.\n");
document.F.CIN.focus();
return false;
}else{
if(NoOnIsChecked()){
alert("Un profil doit etre montionné.\n");
document.F.ProfilTA.focus();
document.F.ProfilAD.focus();
document.F.ProfilSUP.focus();
return false;
}
}
}
}
}
return true;
}
</script></head>
<script LANGUAGE="JavaScript" TYPE="text/javascript">
function isBlank(val){
if(val==null){return true;}
for(var i=0;i<val.length;i++) {
if ((val.charAt(i)==' ')||(val.charAt(i)=="\t")||(val.charAt(i)=="\n")||(val.charAt(i)=="\r")){return true;}
}
return false;
}
function isBeginBlank(val){
if(val==null){return true;}
if ((val.charAt(0)!=' ')&&(val.charAt(0)!="\t")&&(val.charAt(0)!="\n")&&(val.charAt(0)!="\r")){ return false;}
return true;
}
function isInteger(s)
{ var i;
for (i = 0; i < s.length; i++)
{
// Check that current character is number.
var c = s.charAt(i);
if (((c < "0") || (c > "9"))) return false;
}
// All characters are numbers.
return true;
}
function check() {
if (document.F.IDTA.value == "" || isBlank(document.F.IDTA.value) || document.F.IDTA.value.length >55 ) {
alert("Identifiant obligatoire et ne doit pas contenir des blancs.\n");
document.F.IDTA.focus();
return false;
}else{
if(document.F.Password.value == "" || isBlank(document.F.Password.value) || document.F.Password.value.length >55 ){
alert("Mot de passe obligatoire et ne doit pas contenir des blancs.\n");
document.F.Password.focus();
return false;
}else{
if(document.F.Nom.value == "" || isBeginBlank(document.F.Nom.value) || document.F.Nom.value.length >55){
alert("Nom obligatoire et ne doit pas commencer par des blancs.\n");
document.F.Nom.focus();
return false;
}else{
if(document.F.CIN.value.length < 8 || document.F.CIN.value.length >12 || ! isInteger(document.F.CIN.value)|| isBeginBlank(document.F.CIN.value) ){
alert("Numéro CIN est incorrecte ou trop long.\n");
document.F.CIN.focus();
return false;
}else{
if(NoOnIsChecked()){
alert("Un profil doit etre montionné.\n");
document.F.ProfilTA.focus();
document.F.ProfilAD.focus();
document.F.ProfilSUP.focus();
return false;
}
}
}
}
}
return true;
}
</script></head>
<script LANGUAGE="JavaScript" TYPE="text/javascript">
function isBlank(val){
if(val==null){return true;}
for(var i=0;i<val.length;i++) {
if ((val.charAt(i)==' ')||(val.charAt(i)=="\t")||(val.charAt(i)=="\n")||(val.charAt(i)=="\r")){return true;}
}
return false;
}
function isBeginBlank(val){
if(val==null){return true;}
if ((val.charAt(0)!=' ')&&(val.charAt(0)!="\t")&&(val.charAt(0)!="\n")&&(val.charAt(0)!="\r")){ return false;}
return true;
}
function isInteger(s)
{ var i;
for (i = 0; i < s.length; i++)
{
// Check that current character is number.
var c = s.charAt(i);
if (((c < "0") || (c > "9"))) return false;
}
// All characters are numbers.
return true;
}
function check() {
if (document.F.IDTA.value == "" || isBlank(document.F.IDTA.value) || document.F.IDTA.value.length >55 ) {
alert("Identifiant obligatoire et ne doit pas contenir des blancs.\n");
document.F.IDTA.focus();
return false;
}else{
if(document.F.Password.value == "" || isBlank(document.F.Password.value) || document.F.Password.value.length >55 ){
alert("Mot de passe obligatoire et ne doit pas contenir des blancs.\n");
document.F.Password.focus();
return false;
}else{
if(document.F.Nom.value == "" || isBeginBlank(document.F.Nom.value) || document.F.Nom.value.length >55){
alert("Nom obligatoire et ne doit pas commencer par des blancs.\n");
document.F.Nom.focus();
return false;
}else{
if(document.F.CIN.value.length < 8 || document.F.CIN.value.length >12 || ! isInteger(document.F.CIN.value)|| isBeginBlank(document.F.CIN.value) ){
alert("Numéro CIN est incorrecte ou trop long.\n");
document.F.CIN.focus();
return false;
}else{
if(NoOnIsChecked()){
alert("Un profil doit etre montionné.\n");
document.F.ProfilTA.focus();
document.F.ProfilAD.focus();
document.F.ProfilSUP.focus();
return false;
}
}
}
}
}
return true;
}
</script></head>
<script LANGUAGE="JavaScript" TYPE="text/javascript">
function isBlank(val){
if(val==null){return true;}
for(var i=0;i<val.length;i++) {
if ((val.charAt(i)==' ')||(val.charAt(i)=="\t")||(val.charAt(i)=="\n")||(val.charAt(i)=="\r")){return true;}
}
return false;
}
function isBeginBlank(val){
if(val==null){return true;}
if ((val.charAt(0)!=' ')&&(val.charAt(0)!="\t")&&(val.charAt(0)!="\n")&&(val.charAt(0)!="\r")){ return false;}
return true;
}
function isInteger(s)
{ var i;
for (i = 0; i < s.length; i++)
{
// Check that current character is number.
var c = s.charAt(i);
if (((c < "0") || (c > "9"))) return false;
}
// All characters are numbers.
return true;
}
function check() {
if (document.F.IDTA.value == "" || isBlank(document.F.IDTA.value) || document.F.IDTA.value.length >55 ) {
alert("Identifiant obligatoire et ne doit pas contenir des blancs.\n");
document.F.IDTA.focus();
return false;
}else{
if(document.F.Password.value == "" || isBlank(document.F.Password.value) || document.F.Password.value.length >55 ){
alert("Mot de passe obligatoire et ne doit pas contenir des blancs.\n");
document.F.Password.focus();
return false;
}else{
if(document.F.Nom.value == "" || isBeginBlank(document.F.Nom.value) || document.F.Nom.value.length >55){
alert("Nom obligatoire et ne doit pas commencer par des blancs.\n");
document.F.Nom.focus();
return false;
}else{
if(document.F.CIN.value.length < 8 || document.F.CIN.value.length >12 || ! isInteger(document.F.CIN.value)|| isBeginBlank(document.F.CIN.value) ){
alert("Numéro CIN est incorrecte ou trop long.\n");
document.F.CIN.focus();
return false;
}else{
if(NoOnIsChecked()){
alert("Un profil doit etre montionné.\n");
document.F.ProfilTA.focus();
document.F.ProfilAD.focus();
document.F.ProfilSUP.focus();
return false;
}
}
}
}
}
return true;
}
</script></head>
<script LANGUAGE="JavaScript" TYPE="text/javascript">
function isBlank(val){
if(val==null){return true;}
for(var i=0;i<val.length;i++) {
if ((val.charAt(i)==' ')||(val.charAt(i)=="\t")||(val.charAt(i)=="\n")||(val.charAt(i)=="\r")){return true;}
}
return false;
}
function isBeginBlank(val){
if(val==null){return true;}
if ((val.charAt(0)!=' ')&&(val.charAt(0)!="\t")&&(val.charAt(0)!="\n")&&(val.charAt(0)!="\r")){ return false;}
return true;
}
function isInteger(s)
{ var i;
for (i = 0; i < s.length; i++)
{
// Check that current character is number.
var c = s.charAt(i);
if (((c < "0") || (c > "9"))) return false;
}
// All characters are numbers.
return true;
}
function NoOnIsChecked()
{
if(document.F.ProfilTA.checked==""