[英]How to add a text area
I am trying to add an additional text area so I need to duplicate part of this code but I am not sure which part. 我正在尝试添加其他文本区域,因此我需要重复这段代码的一部分,但是我不确定是哪一部分。 Can anyone please help?
谁能帮忙吗?
function mode_add_message()
{
jQuery("#editor").hide();
jQuery("#cropper").hide();
jQuery("#crop_preview_container").hide();
jQuery("#pxn8_canvas").show();
jQuery("#messages").empty();
jQuery("#edit_and_crop").show();
jQuery("#add_text").show("slow");
gAddTextOpNumber = PXN8.opNumber;
if (gCardDB[gActiveCard].text_placeholders){
var placeholders = gCardDB[gActiveCard].text_placeholders;
for (var i = 0;i < placeholders.length; i++){
var text = placeholders[i];
var html = "";
if (text.multiline){
html = "<li><textarea name=\"text_" + i + "\" id=\"text_" + i + "\">Message # " + (i+1) + " Here</textarea></li>";
}else{
html = "<li><input class=\"text\" type=\"text\" name=\"text_" + i + "\" id=\"text_" + i + "\" value=\"Message # " + (i+1) + " here\"></li>";
}
jQuery(html).appendTo("#messages");
}
}else{
end_cardmaker();
}
}
//
// There can be multiple text inputs/textareas so each must be added.
This is the URL: http://pixenate.com/pixenate/themes/cardmaker/index.php 这是URL: http : //pixenate.com/pixenate/themes/cardmaker/index.php
This part of code will help you adding textarea: 这部分代码将帮助您添加textarea:
if (gCardDB[gActiveCard].text_placeholders){
var placeholders = gCardDB[gActiveCard].text_placeholders;
for (var i = 0;i < placeholders.length; i++){
var text = placeholders[i];
var html = "";
if (text.multiline){
html = "<li><textarea name=\"text_" + i + "\" id=\"text_" + i + "\">Message # " + (i+1) + " Here</textarea></li>";
}else{
html = "<li><input class=\"text\" type=\"text\" name=\"text_" + i + "\" id=\"text_" + i + "\" value=\"Message # " + (i+1) + " here\"></li>";
}
jQuery(html).appendTo("#messages");
}
}else{
end_cardmaker();
}
but I'm not sure what those conditions are for, as I haven't had a look at your whole code. 但我不确定这些条件的用途,因为我没有看过您的整个代码。 Just to add a textarea will be:
只需添加一个文本区域将是:
var html = '<li><textarea name="" id="">Message #1 Here</textarea></li>';
jQuery(html).appendTo("#messages");
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.