Jump to content


Photo

Formulário - Só Enviar Se Preencher Corretamente


  • Faça o login para participar
14 replies to this topic

#1 Chrico

Chrico

    Normal

  • Usuários
  • 84 posts
  • Sexo:Não informado

Posted 17/01/2006, 21:31

Ola amigos


Preciso de uma luz!

Tenho o formulário abaixo e gostaria q ele só você enviado após o internauta preencher corretamente o NOME e E-MAIL. É possível isso em HTML??

Formulário em - http://www.venha.com...5/formvotos.htm


Valew a todos pela ajuda

[s] chrico

#2 Chrico

Chrico

    Normal

  • Usuários
  • 84 posts
  • Sexo:Não informado

Posted 17/01/2006, 21:34

Ahhhh uma coisa q esqueci, é possível bloquear o IP da pessoa que já enviou o formulário para q nao envie novamente?

valewwww

#3 Alex Hiroshi

Alex Hiroshi

    Super Veterano

  • Ex-Admins
  • 4923 posts
  • Sexo:Masculino
  • Localidade:São Paulo - SP

Posted 18/01/2006, 06:56

Você pode fazer a validação dos campos com js..
http://forum.wmonlin...howtopic=137493
http://forum.wmonlin...howtopic=135549
(dúvidas, poste)

Sobre bloquear por ip..
Isso seria mais com alguma linguagem dinamica que pegue o ip da pessoa.. Com html não da para fazer isso.. ;)
Fórum WMO - Equipe de Desenvolvimento / Banco de Dados - Ex-Administrador

#4 Chrico

Chrico

    Normal

  • Usuários
  • 84 posts
  • Sexo:Não informado

Posted 18/01/2006, 10:44

Ola Ale

Desculpa mas como sou leigo nisso, até tentei entender o que me passou nos links mas não consegui!

Agradeço muito c puder me dar mais orientação!

[s] chrico

#5 Chrico

Chrico

    Normal

  • Usuários
  • 84 posts
  • Sexo:Não informado

Posted 18/01/2006, 17:23

Consegui arrumar uma aprte do problema, agora o código esta tudo funcionando, porém, no campo e-mail, se a pessoa digitar apenas uma letra qualquer, já consegue enviar.

Para evitar isso, o que devo inserir para que seja enviado somente c a pessoa digitar um 'e-mail' mesmo??


<script language="JavaScript" type="text/javascript">
<!--
function formCheck(formobj){
// Enter name of mandatory fields
var fieldRequired = Array("Nome", "email");
// Enter field description to appear in the dialog box
var fieldDescription = Array("Nome", "email");
// dialog message

var alertMsg = "Por favor, preencha os determinados campos:\n";

var l_Msg = alertMsg.length;

for (var i = 0; i < fieldRequired.length; i++){
 var obj = formobj.elements[fieldRequired[i]];
 if (obj){
  switch(obj.type){
  case "select-one":
   if (obj.selectedIndex == -1 || obj.options[obj.selectedIndex].text == ""){
    alertMsg += " - " + fieldDescription[i] + "\n";
   }
   break;
  case "select-multiple":
   if (obj.selectedIndex == -1){
    alertMsg += " - " + fieldDescription[i] + "\n";
   }
   break;
  case "text":
  case "textarea":
   if (obj.value == "" || obj.value == null){
    alertMsg += " - " + fieldDescription[i] + "\n";
   }
   break;
  default:
  }
  if (obj.type == undefined){
   var blnchecked = false;
   for (var j = 0; j < obj.length; j++){
    if (obj[j].checked){
     blnchecked = true;
    }
   }
   if (!blnchecked){
    alertMsg += " - " + fieldDescription[i] + "\n";
   }
  }
 }
}

if (alertMsg.length == l_Msg){
 return true;
}else{
 alert(alertMsg);
 return false;
}
}
// -->
</script>

no formulário acrecentei:

onsubmit="return formCheck(this)
valew a ajuda

#6 Alex Hiroshi

Alex Hiroshi

    Super Veterano

  • Ex-Admins
  • 4923 posts
  • Sexo:Masculino
  • Localidade:São Paulo - SP

Posted 18/01/2006, 21:27

<script>

function valida(){

var nome = document.getElementById("nome");

var email = document.getElementById("email");

var ermail = /.+@.+\..+/;

var ernome = /[a-z ]/;

if(!ernome.test(nome.value)){

alert("Você não preencheu o nome ou ele não é um nome valido");

return false;

} else if(!ermail.test(email.value)){

alert("Você não preencheu o email ou ele não é um email valido");

return false;

} else {

return true;

}

}

</script>



<form action=".." onsubmit="return valida()">

<input type="text" id="nome" name="nome" />

<input type="text" id="email" name="email" />

<input type="submit" value="Enviar" />

</form>

Fórum WMO - Equipe de Desenvolvimento / Banco de Dados - Ex-Administrador

#7 Chrico

Chrico

    Normal

  • Usuários
  • 84 posts
  • Sexo:Não informado

Posted 19/01/2006, 12:14

Valew Ale

Esse código é enxuto e eficiente!

Só para entender, caso queira tirar, ou acrescentar novos campos o q é necessário??

Eu simulei algumas alterações no código mas sempre da erro!

[s] chrico

#8 computer

computer
  • Visitantes

Posted 19/01/2006, 12:42

Você pode fazer a validação dos campos com js..
http://forum.wmonlin...howtopic=137493
http://forum.wmonlin...howtopic=135549
(dúvidas, poste)

Sobre bloquear por ip..
Isso seria mais com alguma linguagem dinamica que pegue o ip da pessoa.. Com html não da para fazer isso.. ;)

Pegar o IP?

Em ASP dá para fazer. É assim:

Request.ServerVariables("REMOTE_ADDR")


#9 LarPhozyHah

LarPhozyHah

    Super Veterano

  • Usuários
  • 14515 posts
  • Sexo:Masculino
  • Localidade:San Miguel de Tucuman

Posted 17/09/2017, 13:16

Sildenafil 100 online pharmacy Side Effects For Cephalexin Generic Secure Stendra Cod Accepted Internet Overseas Store Exeter Priligy Oder Viagra cheap cialis Viagra Contre Indications
Clomid Probabilite cialis Viagra Professional Online Uk
Viagra Generika Billig Kaufen Cold Balm Propecia En Ligne 1mg
Cod Generic Isotretinoin Direct Discount Amex Accepted <a href=http://cialtobuy.com>cialis buy online</a> Cialis Douleurs Musculaires

#10 LarPhozyHah

LarPhozyHah

    Super Veterano

  • Usuários
  • 14515 posts
  • Sexo:Masculino
  • Localidade:San Miguel de Tucuman

Posted 26/09/2017, 17:50

Cialis Prix France Pharmacie Kamagra Vendita In Svizzera For Sale Secure Online Progesterone Real Next Day cialis Kamagra Oral Jelly Utilisation Lasix For Dog Without Prescription
Propecia Giudizi Cialis Si Puo Dividere cialis Viagra Espanol Tadacip 20 Canada Acyclovir Pills For Sale In U.S.
Furosemide Over The Counter Substitute Amoxicillin Vs Penecillin cialis buy online Propecia Frontale Commander Cialis Generique En France

#11 Miguceamma

Miguceamma

    MiguPenjisse

  • Usuários
  • 13201 posts

Posted 26/09/2017, 19:16

Levitra Feminin cialis price Herbal Propecia Propecia Canada Pharmacy Online Viagra 50mg Bestellen

#12 LarPhozyHah

LarPhozyHah

    Super Veterano

  • Usuários
  • 14515 posts
  • Sexo:Masculino
  • Localidade:San Miguel de Tucuman

Posted 05/10/2017, 23:19

Levitra Italia Pillole Propecia 1 Mg Cheap Kamagra Fast Delivery viagra Apo Amoxicillin Viagra En Farmacias Espana
Acquisto Viagra Online Reato viagra Viagra Discount Sales Can You Buy Ciprofloxacin 500 Mg Online buy Female Viagra
Kamagra Australia Shop whoesale levitra pills Bay Viagra Cials

#13 LarPhozyHah

LarPhozyHah

    Super Veterano

  • Usuários
  • 14515 posts
  • Sexo:Masculino
  • Localidade:San Miguel de Tucuman

Posted 21/10/2017, 15:03

Viagra Rezept Apotheke Propecia Liver Damage Herbal Cataflam Zithromax viagra Cialis Ohne Rezept Cialis Y Aspirina Buy Prevacid Online
Viprogra Medication Online Pharmacy Viagra Sin Receta Foro Propecia 1mgacheter Propecia France viagra Priligy Generico En Farmacias Finasteride Precio Espana Propecia
Synthese Levitra Cialis Originale Al Prezzo Piu Basso Commander Cialis Generique En France viagra How To Buy Colchicine Online With No Rx

#14 LarPhozyHah

LarPhozyHah

    Super Veterano

  • Usuários
  • 14515 posts
  • Sexo:Masculino
  • Localidade:San Miguel de Tucuman

Posted 31/10/2017, 19:47

Priligy Dapoxetina Senza Ricetta buy levitra safely from canada Best Buy Real Fluoxetine Drugs Pharmacy By Money Order
Pharmacy Prices For Levitra Macrobid In Australia viagra Shipped Ups Macrobid Medication Store Propecia Vendo
Levitra Dosage 40mg Snorting Amoxicillin Viagra Sur Internet Danger viagra How Can I Buy Cialis In A Store In Ct Cialis Hyper Puissant En Ligne

#15 LarPhozyHah

LarPhozyHah

    Super Veterano

  • Usuários
  • 14515 posts
  • Sexo:Masculino
  • Localidade:San Miguel de Tucuman

Posted 29/11/2017, 09:03

Propecia Online Order Cheap viagra Keflex Clomid
Propecia Effetti Collaterali Di Finasteride Generic Amoxicilina Website On Line viagra Viagra Aux Encheres Kamagra Without Prescription Cialis En Francia
Where To Purchase Alli 60 Mg In Europe viagra Levitra Receta
Levitra 20mg 30 Tablet Buy Azithromycin Online buy vardenafil 40 mg malaysia Can Women Take Kamagra Kamagra Tablets Online
Kamagra Uso Oral Jelly Propecia O Omnic cialis Donde Comprar Xenical En Usa Generico Francia Sildenafil
Robaxin Otc Usa Viagra 82 Anni buy viagra online Celecoxib Online Need Prescription Amoxicillin
Cialis Mg 10 cialis online Citalopram Purchase With A Mastercard
Generika Viagra Amoxicillin 875 Mg viagra Comparateur prix cialis france Comprar Viagra A Domicilio Order Prednisone From Canada
Viagra For Sale Online Ireland Zithromax And Pregnancy levitra 40 mg Propecia Farmacocinetica




0 user(s) are reading this topic

0 membro(s), 0 visitante(s) e 0 membros anônimo(s)

IPB Skin By Virteq