我正在寻找一个库,可以在从按钮点击事件后将我的网页转换为PDF文件.我正在尝试jspdf,但它打印没有CSS,我怎么能使用JavaScript/jQuery并保留我的CSS?还是我可以选择的另一个CSS?
我正在开发一些供我公司使用的表格.我咨询并将数据插入到数据库中,但对于标准问题,我想将我输入的文本转换为大写,我该怎么做?
我的一个表格示例:
我希望我输入的文本字段自动转换为大写,或者我输入数据库的数据已经转换为大写(在用户不以这种方式输入的情况下).
编辑:
我试试
$("tbCiudad").change(function() {
$(this).val($(this).val().toUpperCase());
});
Run Code Online (Sandbox Code Playgroud)
要么
$("tbCiudad").keyup(function() {
$(this).val($(this).val().toUpperCase());
});
Run Code Online (Sandbox Code Playgroud)
那个领域没有任何反应.我究竟做错了什么?
我遇到了模态对话框的问题,它在用户按下和输入按钮时激活,然后模态对话框显示,并立即消失而不做任何事情.
代码:
$('form').submit(function(e) {
var dialog = $("#dialog");
if ($("#dialog").length == 0) {
dialog = $('<div id="dialog" style="display:hidden"> Los datos ingresados son:</div>').appendTo('body');
}
dialog.load(
$("#dialog").dialog({
close: function(event, ui) {
dialog.remove();
},
resizable: false,
//height: 140,
//width: 460
modal: true,
buttons: {
"Ok": function() {
$(this).dialog("close");
},
Cancel: function() {
$(this).dialog("close");
}
}
})
);
return true;
});
Run Code Online (Sandbox Code Playgroud)
此外,我怎样才能做到这一点,当用户在模态对话框中按ok时,事件会继续?
我想验证一个数字是否有某些参数,例如我想确保一个数字有3位小数是正数.我通过互联网搜索了不同的地方,虽然我找不到怎么做.我已将该文本框设为仅接受数字.我只需要其他功能.
谢谢,
$("#formEntDetalle").validate({
rules: {
tbCantidad: { required: true, number: true },
tbPrecioUnidad: { required: true, number: true },
}
messages: {
tbCantidad: { required: "Es Necesario Entrar una cantidad a la orden" },
tbPrecioUnidad: { required: "Es Necesario Entrar el valor valido para el producto" }
},
errorPlacement: function(error, element) {
parent = element.parent().parent();
errorPlace = parent.find(".errorCont");
errorPlace.append(error);
}
});
Run Code Online (Sandbox Code Playgroud)
我想用以下内容控制该文本框:
$.validator.addMethod('Decimal',
function(value, element) {
//validate the number
}, "Please enter a correct number, format xxxx.xxx");
Run Code Online (Sandbox Code Playgroud)