Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Button on HTML calling VB function

Posted on 2004-11-24
2
Medium Priority
?
216 Views
Last Modified: 2010-04-01

Have a button calling a vb function on the click event.
I'd like to pass the filepath/filename into the function using file input type button..
How do I do this?
Thanks
C.
0
Comment
Question by:skellyc
  • 2
2 Comments
 
LVL 14

Expert Comment

by:sudhakar_koundinya
ID: 12668653
<html>
<Script Language=VBScript>

function readFile (file)
on error resume next
Set objFSO = CreateObject("Scripting.FileSystemObject")
vText = ""
'input text file
Set objTF = objFSO.OpenTextFile(file)

    do while not objTF.AtEndofStream
     vText = vText & objTF.Readline
    loop

Set objTF = nothing
Set objFSO = nothing
readFile=vText
end function

sub read_OnClick()
testform.fileholder.value=readfile( testform.testfile.value)
end sub

</script>

<body>
<form name=testform>
<P>
<input type=file name=testfile >&nbsp;&nbsp; <INPUT type=button value=read name=read></P>
<P> <INPUT style="WIDTH:
 511px; HEIGHT: 173px" size=1443 name=fileholder rows="100"
cols="100" readonly width="44" vspace=44>
</P>
</form>
</body>

</html>
0
 
LVL 14

Accepted Solution

by:
sudhakar_koundinya earned 2000 total points
ID: 12668656
I have already posted the same in ur previous thread
0

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Dropbox has a relatively new feature called Smart Sync.  This feature allows Dropbox Professional (not plus) and Dropbox Business (if enabled) users to store information in Dropbox WITHOUT storing any files on their computer.
Why WooCommerce is one of the majorly favored choices when it comes to having an eCommerce store. This article will acquaint you with some reasons that I believe make it one of the best eCommerce platforms available.
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Kernel Data Recovery is a renowned Data Recovery solution provider which offers wide range of softwares for both enterprise and home users with its cost-effective solutions. Let's have a quick overview of the journey and data recovery tools range he…
Suggested Courses

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question