禁用word -wrap而不在asp.net中使用 [英] disable word -wrap without using in asp.net
本文介绍了禁用word -wrap而不在asp.net中使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
hi
我做了以下一段代码。
hi
I have done the following piece of code .
<asp:Label ID="lblUploadW9" runat="server" Text="Upload W-9" /><span class="reqd">*</span>
</div>
<div class="sxlm">
<asp:FileUpload ID="fupUploadW9" runat="server" />
<div class="vldx">
<asp:Label runat="server" ID="lblUploadW9FileName" Text="" Style="word-break: hyphenate;"></asp:Label>
<asp:CustomValidator class="errmsg" ID="cusUploadW9" runat="server" ValidationGroup="grpSupAccData"
Display="Dynamic" ClientValidationFunction="validateUploadW9" OnServerValidate="cusUploadW9_ServerValidate" />
</div>
</div>
jav ascript是:
the jav ascript is :
function validateUploadW9(source, e)
{
var fileName = FSObject.$("[id$=fupUploadW9]")[0].value;
var fileExtension = fileName.substring(fileName.lastIndexOf('.') + 1);
if (fileName == "")
{
var length = FSObject.$("[id$=lblUploadW9FileName]").length;
if (FSObject.$("[id$=lblUploadW9FileName]")[length - 1].innerHTML == "")
{
e.IsValid = false;
}
else
{
if (fileExtension != ".doc" || ".DOC " || ".txt" || ".docx" || ".DOCX" || ".TXT" || ".xls" || ".xlsx" || ".XLS" || ".XLSX" || ".pdf" || ".PDF")
{
FSObject.$("[id$=cusUploadW9]")[0].innerHTML = "Invalid extension, only .doc, .docx, .txt, .xls, .xlsx, .pdf and .jpg extensions are supported";
e.IsValid = false;
}
else
{
e.IsValid = true;
}
}
}
else {
if (fileExtension != ".doc" || ".DOC " || ".txt" || ".docx" || ".DOCX" || ".TXT" || ".xls" || ".xlsx" || ".XLS" || ".XLSX" || ".pdf" || ".PDF")
{
FSObject.$("[id$=cusUploadW9]")[0].innerHTML = "Invalid extension, only .doc, .docx, .txt, .xls, .xlsx, .pdf and .jpg extensions are supported";
e.IsValid = false;
}
else
{
e.IsValid = true;
}
}
}
一切正常,但问题是在输入无效文件类型时,消息显示包含文件上传控件,我希望消息显示在下一行,而不使用
标签。
everything works fine,but the problem is that on entering invalid file type the message gets displayed wrapped with the file-upload control,I want the message to be displayed at the next line,without using
tag.
推荐答案
( [id
("[id
= fupUploadW9] )[ 0 ]。value;
var fileExtension = fileName.substring(fileName.lastIndexOf(' 。')+ 1 );
if (fileName == )
{
var length = FSObject。
=fupUploadW9]")[0].value; var fileExtension = fileName.substring(fileName.lastIndexOf('.') + 1); if (fileName == "") { var length = FSObject.
( [id
("[id
这篇关于禁用word -wrap而不在asp.net中使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文