gene4455
10-22-2008, 10:42 AM
Hi,
I am new to programming in VB Script and I have tried researching to find out ways to achieve what I am trying to do. Any help would be appreciated.
I am trying to make a program that adds forms/documents to an intranet site. My idea of how i have been trying to code it is as follows.
I have two textboxes and I am using activeX to write my code.
I am using VB Script.
The first textbox should hold a form's/document name entered by a user.
The second textbox should hold the directory to where the form is located on the local disk/drive
I also have a button named "add"
The Problem is this:
1. I am trying to make a link. This link will be made when a user enters text into the first textbox.(Using the text entered by the user as the link name)
2. This link will now show up in a new page under a sub heading for example: Genres, Document type, Book type or something of that nature
3. When the link is clicked it should open up a document of any sort. But this will only happen as long as the user has put in the location of the document in the second
textbox.
4. I have chosen to make a folder on the C: drive. This folder will hold all the documents or forms that the users will be adding to the site (should they need to add a
document or form)
5. But i would like to program the second text box to reference only the C: drive.
for an example
the way the user would enter the directory path to the document would be typically;
"C:\Documents and Settings\All Users\Document_Name"
6. Instead of "C:\Documents and Settings\All Users\Document_Name" I wanted it to be this "\All Users\Document_Name"
7. I don't really know how to program the second texbox to accept only this "\All Users\Document_Name"
All this would be processed when the user clicks the "Add" button.
8. Then on the click of the "add" button it should direct the user to the web page with the new link being what they entered in the first textbox.
9. I would like to group it into headings according to the information the document may contain.
The code i have so far is below:
<HTML>
<HEAD>
<TITLE>Information</TITLE>
</HEAD>
<BODY>
<FIELDSET>
Form Name: <br>
<INPUT TYPE="TEXT" NAME="TxtFormname">
<br>
Location: <br>
<INPUT TYPE="TEXT" NAME="TxtFormdirectory">
<br>
<INPUT TYPE="SUBMIT" VALUE="Add" NAME="Btn1">
</FIELDSET>
<SCRIPT LANGUAGE="VBScript">
<!--
Sub Btn1_OnClick
If TxtFormname.Value = " " Or TxtFormdirectory.Value = " " Then
Dim Message
Message = "Form Name Or Location Of Document Required"
MsgBox(Message)
End If
End Sub
-->
</SCRIPT>
</BODY>
</HTML>
Any help would be appreciated. Thank you all in advance.
:(
I am new to programming in VB Script and I have tried researching to find out ways to achieve what I am trying to do. Any help would be appreciated.
I am trying to make a program that adds forms/documents to an intranet site. My idea of how i have been trying to code it is as follows.
I have two textboxes and I am using activeX to write my code.
I am using VB Script.
The first textbox should hold a form's/document name entered by a user.
The second textbox should hold the directory to where the form is located on the local disk/drive
I also have a button named "add"
The Problem is this:
1. I am trying to make a link. This link will be made when a user enters text into the first textbox.(Using the text entered by the user as the link name)
2. This link will now show up in a new page under a sub heading for example: Genres, Document type, Book type or something of that nature
3. When the link is clicked it should open up a document of any sort. But this will only happen as long as the user has put in the location of the document in the second
textbox.
4. I have chosen to make a folder on the C: drive. This folder will hold all the documents or forms that the users will be adding to the site (should they need to add a
document or form)
5. But i would like to program the second text box to reference only the C: drive.
for an example
the way the user would enter the directory path to the document would be typically;
"C:\Documents and Settings\All Users\Document_Name"
6. Instead of "C:\Documents and Settings\All Users\Document_Name" I wanted it to be this "\All Users\Document_Name"
7. I don't really know how to program the second texbox to accept only this "\All Users\Document_Name"
All this would be processed when the user clicks the "Add" button.
8. Then on the click of the "add" button it should direct the user to the web page with the new link being what they entered in the first textbox.
9. I would like to group it into headings according to the information the document may contain.
The code i have so far is below:
<HTML>
<HEAD>
<TITLE>Information</TITLE>
</HEAD>
<BODY>
<FIELDSET>
Form Name: <br>
<INPUT TYPE="TEXT" NAME="TxtFormname">
<br>
Location: <br>
<INPUT TYPE="TEXT" NAME="TxtFormdirectory">
<br>
<INPUT TYPE="SUBMIT" VALUE="Add" NAME="Btn1">
</FIELDSET>
<SCRIPT LANGUAGE="VBScript">
<!--
Sub Btn1_OnClick
If TxtFormname.Value = " " Or TxtFormdirectory.Value = " " Then
Dim Message
Message = "Form Name Or Location Of Document Required"
MsgBox(Message)
End If
End Sub
-->
</SCRIPT>
</BODY>
</HTML>
Any help would be appreciated. Thank you all in advance.
:(