Ir para conteúdo
Fórum Script Brasil

Andreia Dias

Membros
  • Total de itens

    2
  • Registro em

  • Última visita

Sobre Andreia Dias

Andreia Dias's Achievements

0

Reputação

  1. :D Oi Jissa Na verdade, rola assim: - eu só consigo checar os dados que vão dentro dos campos, mas não consigo fazer os agendamentos de 30 em 30 minutos. vale informar que eu uso uma API ... que não pode ser alterada, e que controla tudo. <body onLoad="document.theForm.ConferenceName.focus()"> <script Language="JavaScript"> function SchedValidator(theForm) { // Init JavaScript variables var validDigits = "0123456789"; var validNumeric = validDigits + "-"; var validLetters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; var validSpec = " !#$%&()*+,./:<=>?@[\\]^_`{|}~"; var validSpecial = validSpec + "\"';"; var validASCII = validNumeric + validLetters + validSpecial; var checkOK, checkStr, allValid; //Check StartTimeHour not empty if (theForm.StartTimeHour.value.length == 0) { alert("Você deve definir o horário de início de sua conferência."); theForm.StartTimeHour.focus(); return (false); } //Check StartTimeHour contains valid chars checkOK = validDigits; checkStr = theForm.StartTimeHour.value; allValid = true; for (i = 0; i < checkStr.length; i++) { ch = checkStr.charAt(i); for (j = 0; j < checkOK.length; j++) if (ch == checkOK.charAt(j)) break; if (j == checkOK.length) { allValid = false; break; } } if (!allValid) { alert("Por Favor, digite somente números nos campos de horário."); theForm.StartTimeHour.focus(); return (false); } //Check StartTimeHour is in range [1-12] if (parseInt(theForm.StartTimeHour.value) < 1 || parseInt(theForm.StartTimeHour.value) > 12) { alert("O horário de início de sua conferência deve estar entre 1 e 12."); theForm.StartTimeHour.focus(); return (false); } //Check StartTimeMinute not empty if (theForm.StartTimeMinute.value == 0) { alert("Você deve definir os minutos no horário de início da coferência."); theForm.StartTimeMinute.focus(); return (false); } //Check StartTimeMinute contains valid chars checkOK = validDigits; checkStr = theForm.StartTimeMinute.value; allValid = true; for (i = 0; i < checkStr.length; i++) { ch = checkStr.charAt(i); for (j = 0; j < checkOK.length; j++) if (ch == checkOK.charAt(j)) break; if (j == checkOK.length) { allValid = false; break; } } if (!allValid) { alert("Por Favor, digite somente números nos campos the horário."); theForm.StartTimeMinute.focus(); return (false); } //Check StartTimeMinute is in range [0-30] if (parseStr(theForm.StartTimeMinute.value) != 0 || parseStr(theForm.StartTimeMinute.value) != 30) { alert("Start Time Minute must be 0 or 30"); theForm.StartTimeMinute.focus(); return (false); } //Check EndTimeHour not empty if (theForm.EndTimeHour.value.length >30) { alert("Você deve definir tempos de 30 minutos."); theForm.EndTimeHour.focus(); return (false); } //Check EndTimeHour contains valid chars checkOK = validDigits; checkStr = theForm.EndTimeHour.value; allValid = true; for (i = 0; i < checkStr.length; i++) { ch = checkStr.charAt(i); for (j = 0; j < checkOK.length; j++) if (ch == checkOK.charAt(j)) break; if (j == checkOK.length) { allValid = false; break; } } if (!allValid) { alert("Por Favor, digite somente números nos campos the horário."); theForm.EndTimeHour.focus(); return (false); } //Check EndTimeHour is in range [1-12] if (parseInt(theForm.EndTimeHour.value) < 1 || parseInt(theForm.EndTimeHour.value) > 12) { alert("O horário de término de sua conferência deve estar entre 1 e 12."); theForm.EndTimeHour.focus(); return (false); } //Check EndTimeMinute not empty if (theForm.EndTimeMinute.value.length == 0) { alert("Você deve definir os minutos no horário de término da coferência."); theForm.EndTimeMinute.focus(); return (false); } //Check EndTimeMinute contains valid chars checkOK = validDigits; checkStr = theForm.EndTimeMinute.value; allValid = true; for (i = 0; i < checkStr.length; i++) { ch = checkStr.charAt(i); for (j = 0; j < checkOK.length; j++) if (ch == checkOK.charAt(j)) break; if (j == checkOK.length) { allValid = false; break; } } if (!allValid) { alert("Por Favor, digite somente números nos campos the horário."); theForm.EndTimeMinute.focus(); return (false); } //Check EndTimeMinute is in range [0-59] if (parseInt(theForm.EndTimeMinute.value) < 0 || parseInt(theForm.EndTimeMinute.value) > 59) { alert("Os minutos de término da conferência devem estar entre 0 e 59."); theForm.EndTimeMinute.focus(); return (false); } Tks...
  2. :( Oi Gladisson, será que você pode me ajudar? Preciso de uma função (acho que é isso) que faça a seguinte verificação: tenho agendamentos de reuniões que só podem ser agendadas com tempos de 30 minutos ou mais que 30. Ou seja, uma reunião pode começar ás 9:37 e tem que terminar no mínimo ás 10:07, se passar disso tudo bem .... tenho os campos - hora de inicio - minuto de inicio - hora de termino - minuto de término Tks, valeu! :(
×
×
  • Criar Novo...