PC SOFT
ONLINE REPOSITORY
FOR WINDEVWEBDEV AND WINDEV MOBILE

Home |  | Sign in | English US
WEBDEV exemplo mascara Jquery e TabEnter Javascript e Calc Indirection
Published by Boller
in the category Tools
New features



Description
WEBDEV exemplo mascara Jquery e TabEnter Javascript

video

https://youtu.be/lhK78fRU7A0



Como usar mascaras no WEBDEV usando JQuery no WEBDEV
===============================================
1-Copiar para o diretorio do projeto, na subpasta do projeto_WEB esses 2 arquivos que tem no Repositorio:

jquery-3.6.0.js
jquery.maskedinput.js

COPIAR E COLAR

2 - Colocar os campos na tela

3 - Colocar o controle "Jquery" na tela, pelo Menu Creation, Web Component, JQuery
Redimensionamos o controle Jquery na tela
Botao direito do mouse, Description - Adicionamos os 2 arquivos jquery-3.6.0.js e jquery.maskedinput.js
OK

4 - No open da janela em CODE:

EMBED - LOAD BROWSER EVENT

//Mascaras - interligas com o controle JQuery na tela
jQuery(EDT_T001_cep).find("input").mask("99.999-999")
jQuery(EDT_T001_cnpj).find("input").mask("99.999.999/9999-99")
jQuery(EDT_T001_cpf).find("input").mask("999.999.999-99")
jQuery(EDT_T001_rg).find("input").mask("999.999.999.999")
jQuery(EDT_T001_telefone).find("input").mask("(+99) 99 99999 9999")

----------------------------------------------------------------------------------------------------------

TAB passar a ser Enter usando JQuery
==============================

<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script>
$(document).on("keypress", "input", FUNCTION(e){
IF(e.which == 13){
var inputVal = $(This).Val();
//alert("You've entered: " + inputVal);
e.preventDefault();
var inputs = $(This).closest('form').find(':input:visible');
inputs.eq( inputs.index(This)+ 1 ).focus();
}
});
</script>


----


PROCEDURE Calcula(TextoBotao)

IF TextoBotao <> "" AND TextoBotao <> "="

EDT_Valor += {TextoBotao}..Caption //INDIRECTION

ELSE

//COMPILE = https://help.WINDEV.com/?3013015

ExecuteFormula is string = "EDT_Valor = "+EDT_Valor.Value

Formula is procedure = Compile(ExecuteFormula)

IF ErrorOccurred = False THEN
Formula()
ELSE
Info(ErrorInfo())
END

END


__________Outro exemplo________

<script language="javascript"type="text/javascript"src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.2.min.js"></script>
<script language="javascript"type="text/javascript">
$(document).ready(function(e) {
$('input').keydown( function(e) {
var key = e.charCode ? e.charCode : e.keyCode ? e.keyCode : 0;
if(key == 13) {
e.preventDefault();
var inputs = $(this).closest('form').find(':input:tabbable');
inputs.eq( inputs.index(this)+ 1 ).focus();
}
if(key == 38) {
e.preventDefault();
var inputs = $(this).closest('form').find(':input:tabbable');
inputs.eq( inputs.index(this)- 1 ).focus();
}
});
});
</script>


Illustrations, screen shots
none
none
User reviews
(To evaluate this resource, click 'Write a review')
No review or comment? Be the first one!
ABOUT
RATING:
00No rating
DOWNLOADS:
53
UPDATED:
May 31, 2021
VERSION:
26
CONCERNS:
WEBDEV
Minimum version: 26
SIZE:
25.6 MB