我正在尝试格式化HTML DIV元素,以便它在移动设备上响应.我的目标是让潜水始终填充任何移动设备的100%宽度和高度,无论是ipad,iphone还是androd设备.IE浏览器尺寸不同.
但是,我无法使用此代码执行此操作.哪里和我错了?
我的DIV元素:
<!---Main Responsive DIV --->
<div class="fullscreen" id="fullscreen">
<!--- This is where we draw. --->
<div align="center" style="vertical-align:middle">
<canvas
id="canvas"
width="400"
height="250"
style="border:3px dashed #000000;">
</canvas>
</div>
<!---
This is the form that will post the drawing information
back to the server.
--->
<cfoutput>
<form action="signature_action.cfm?ticketID=#url.ticketID#&TT=#url.TT#&techID=#url.techID#&device=ipad" method="post">
<!--- The canvas dimensions. --->
<input type="hidden" name="width" value="1000" />
<input type="hidden" name="height" value="615" />
<!--- The drawing commands. --->
<input type="hidden" name="commands" value="" />
<!--- This is the export …Run Code Online (Sandbox Code Playgroud) 我有一个小的表格,我想将文件上传到CF服务器。过去,我可以通过传统的操作页面提交CFFORM来完成此工作。但是我想使用AJAX上传文件。
我在处理页面上收到如下错误:cffile action =“ upload”要求表单使用enctype =“ multipart / form-data”,即使我已经这样定义了表单。
从google'ng到周围,我认为可能是因为Cffile要求filefield属性,但是由于没有表单对象传递给coldfusion。可能类似的问题。我不太喜欢这个解决方案。
无论如何,我可以解决这个错误吗?
这是我的AJAX:
<!---Script to upload file link --->
<cfoutput>
<script>
$(function(){
//Add a new note to a link
$("##upload-file").submit(function(event){
// prevent native form submission here
event.preventDefault();
$.ajax({
type: "POST",
data: $('##upload-file').serialize(),
url: "actionpages/file_upload_action.cfm",
beforeSend: function(){
$('.loader').show();
},
complete: function(){
$('.loader').hide(3000);
},
success: function() {
PopulateFileUploadDiv();
$("##upload").val('');
$("##response").append( "File successfully Uploaded." );
}
});
return false;
});
});
</script>
</cfoutput>
Run Code Online (Sandbox Code Playgroud)
我的表格:
<form method="post" name="upload-file" id="upload-file" enctype="multipart/form-data">
<input tabindex="0" size="50" …Run Code Online (Sandbox Code Playgroud) 我目前正在使用以下代码加密用户密码并将它们存储在我的数据库中:
<cfset encrypted_pass = Hash(#form.pwd#, 'SHA-512')/>
Run Code Online (Sandbox Code Playgroud)
有没有办法事后解密这个密码?
我这里有一个奇怪的问题.我正在使用jquery调用CFC并返回一个字符串.然后我尝试使用该字符串填充表单字段.出于某种原因,我的回复是包含HTML代码以及查询结果.
以下是JSON响应在控制台中的显示方式:
> Gary Turner check_out.cfm:146 Successfully ran JSON, now changing
> input value check_out.cfm:149 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML
> 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <head>
> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
>
> </head> <body>
>
>
>
>
>
> </body>
> 274.00
Run Code Online (Sandbox Code Playgroud)
这是我的JQUERY:
<!---Populate Grand Total --->
<script>
function PopulateGrandTotal(){
// Populate the customer alert DIV based on the customer selection
console.log( $("#customer_checkout>option:selected").attr("Value") );
$.ajax({
url:'cfcs/grand_totalDIV.cfc?method=getTotal&returnformat=json',
//dataType: 'text',
data: { customer_checkout: $("#customer_checkout>option:selected").attr("Value") },
success: function(response) {
console.log('Successfully ran …Run Code Online (Sandbox Code Playgroud) 正如标题所述,我正在尝试执行一个简单的任务,当我的ajax帖子成功完成数据库查询时,我想使用AJAX成功选项将"Success"添加到空DIV中.我无法弄清楚如何让文字出现.任何帮助表示赞赏.谢谢.
这是我工作的AJAX帖子:
<script>
$(function(){
$("#noteForm").submit(function(){
// prevent native form submission here
$.ajax({
type: "POST",
data: $('#noteForm').serialize(),
dataType: 'json',
url: "actionpages/link_notes_action.cfm?id=2",
success: function() {
$(".response").append($( "Success" ) );
}
});
return false;
});
});
</script>
Run Code Online (Sandbox Code Playgroud)
我的页面中有一个div,其id为"response",嵌套在我的表单的div中.
<!--- Modal HTML embedded directly into document --->
<div id="LinkNotes#id#" style="display:none;">
<p>These are the notes for: #link_description#</p>
<form id="noteForm">
<textarea id="noteText" name="noteText" cols="45" rows="10">#notes#</textarea><br />
<input name="submit" id="submitForm" type="submit" value="Update"><div class="response" id="response"></div>
<input type="hidden" name="hidden" value="#get_dashboard_links.ID#">
</form>
</div>
Run Code Online (Sandbox Code Playgroud) 我有一个简单的查询,它通过ID来提取记录列表:
<cfquery name="resTotals" datasource="#datasource#">
SELECT ticket_id
FROM closed_tickets
WHERE YEAR(closed_date) = '2017'
AND ticket_type = 'residential'
</cfquery>
Run Code Online (Sandbox Code Playgroud)
然后我尝试在另一个不同表的查询中循环访问这些ID,以便检查是否存在付款记录.目标是总计所有支付记录,以获得支付美元的总金额.
我有这个查询,但它抛出一个错误:不能将字符串[99.00]转换为类型[数组]的值
<cfloop query="resTotals">
<cfquery name="resPaymentTotals" datasource="#datasource#">
SELECT payment_amount
FROM payments
WHERE ticket_id = #resTotals.ticket_id#
</cfquery>
</cfloop>
Amount of Sales: $ #ArraySum(resPaymentTotals.payment_amount)#
Run Code Online (Sandbox Code Playgroud)
我究竟做错了什么?我是在正确的轨道上吗?
我有一个JQuery脚本,我希望将其集成到我在本网站上的一篇文章中找到的ColdFusion应用程序中.它是一个简单的脚本,用于在表单字段中的光标处插入文本.它必须比我找到的JavaScript解决方案更简单.
jQuery("#btn").on('click', function() {
var caretPos = document.getElementById("txt").selectionStart;
var textAreaTxt = jQuery("#txt").val();
var txtToAdd = "stuff";
jQuery("#txt").val(textAreaTxt.substring(0, caretPos) + txtToAdd + textAreaTxt.substring(caretPos) );
});
Run Code Online (Sandbox Code Playgroud)
我遇到的问题是ColdFusion将JQuery表单名称#btn -or- #txt视为无效结构.我想它预计会有一个coldfusion变量.
有没有办法解决?
我正在使用表单将日期添加到我的MySQL数据库中.该列的数据类型为datetime,列名为_date.
要输出我的数据,我使用此代码:
<cfoutput>
<cfquery name="vehiclelogDate" datasource="#datasource#">
select ID, '_date'
from vehicle_log
where vehicle_id = <cfqueryparam value="#url.id#">
order by _date ASC
</cfquery>
<cfset fist_year = DATEPART("yyyy",'#vehiclelogDate._date#')>
#first_year#
</cfoutput>
Run Code Online (Sandbox Code Playgroud)
当我这样做时,我收到错误:值_date无法转换为日期.
我最近从Access测试数据库转换为MYSQL,现在出现了这个错误.
有人可以帮忙吗?
我正在尝试实现在这里找到的JQuery-steps插件:https : //github.com/rstaib/jquery-steps
我不知道如何提交表格。我目前不使用字段验证。
这是我的JS:
<script>
$(function ()
{
$("#wizard").steps({
headerTag: "h2",
bodyTag: "section",
transitionEffect: "slideLeft",
onFinishing: function (event, currentIndex)
{
var form = $(this);
// Disable validation on fields that are disabled.
// At this point it's recommended to do an overall check (mean ignoring only disabled fields)
//form.validate().settings.ignore = ":disabled";
// Start validation; Prevent form submission if false
//return form.valid();
},
onFinished: function (event, currentIndex)
{
var form = $(this);
// Submit form input
form.submit();
}
}); …Run Code Online (Sandbox Code Playgroud) coldfusion ×6
jquery ×4
javascript ×2
ajax ×1
cfc ×1
cffile ×1
cfloop ×1
cfquery ×1
css ×1
html ×1
jquery-steps ×1
lucee ×1
mysql ×1