从上传的文件中获取文本字段数据 [英] Getting Text Fields Data from the Uploaded file

查看:102
本文介绍了从上传的文件中获取文本字段数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有一份注册表,在其中有诸如firstName,Lastname,Phno,Emailid,Address等字段,
我可以选择上传文件.
我的问题是上载文件时必须自动将表单字段中的所有值插入.

您可以提供想法或链接吗?

任何帮助将不胜感激.

在此先感谢
Anupama

Hi,

I Have A registration Form where in i Have fields like firstName,Lastname,Phno,Emailid, Address etc.,
i have an option to upload file.
my problem is all the values into the fields of the form have to be inserted automatically when the file is uploaded.

can u help with the ideas or links.

any help would be appreciated.

Thanks in Advance
Anupama

推荐答案

您要问的是不可能的.根据这种模糊的描述,我们可以给出什么样的想法"?文件采用什么形式?为什么不能读取文件并进行解析?你困在哪里?你尝试了什么?

解析文件,查找数据并设置表单元素的值,对我来说似乎很简单.
What you''re asking is impossible. What sort of ''ideas'' can we give, based on this vague description ? What form does the file take ? Why can''t you read the file and parse it ? Where are you stuck ? What have you tried ?

Parse the file, find the data, and set the values of the form elements, seems simple to me.



您必须使用Jquery简化解决方案,请在下面尝试以下代码,
在您的注册页面中
Hi,
You have to use Jquery to make the solution simple,Try this code below,
in your registration page
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
    <script type="text/javascript">
        function FireUploadEvent(val) {


(#%> ).click(); } < /script > < asp:fileupload id =" runat 服务器" onchange javascript:FireUploadEvent();" ">/ > < div =" < asp:button 运行 =" id UploadButton " 文本 上传" onclick UploadButton_Click" / > < /div >
("#<%= UploadButton.ClientID %>").click(); } </script> <asp:fileupload id="FileUploadControl" runat="server" onchange="javascript:FireUploadEvent();" /> <div style="visibility: hidden"> <asp:button runat="server" id="UploadButton" text="Upload" onclick="UploadButton_Click" /> </div>


UploadButton_Click事件处理程序中,您可以包括数据插入逻辑.
希望这能解决您的问题.


in UploadButton_Click event handler, you can include data insertion logics.
Hope this will address your issue.


这篇关于从上传的文件中获取文本字段数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆