Passing A Filename
Jul 23, 2005
<script type="text/vbscript">
Dim objWord
Sub Btn1_onclick()
call OpenDoc("K:DeloitteTeam1 Status reportJavaProgramshi.txt")
End Sub
Sub OpenDoc(strLocation)
Set objWord = CreateObject("Word.Application")
objWord.Visible = true
objWord.Documents.Open strLocation
End Sub
</script>
I would like to pass the filename used above in the button code below so
the above code could be coded only once and then mutiple button code
could be used.
<td><INPUT TYPE=BUTTON NAME=Btn1 VALUE="Requirements Template"></td>
View 2 Replies
ADVERTISEMENT
Feb 27, 2010
I'm trying to figure out a way to pass the filename before submission... I think I have to make an onChange command on the file field, but not sure how...
This is what I have done so far:
<script type="text/javascript">
function theimage(){
var imgURL = document.getElementById('myfile').value;
ste.execCommand("insertimage", imgURL);
}
</script>
<input name="myfile" type="file" size="30" onchange="theimage();">
I'm trying to pass the value to theimage as sson the filename changes, but I'm doing something wrong...
Any help is apreciated...
View 8 Replies
View Related
Dec 20, 2009
I'm amending an upload script from Max's AJAX file uploader. [URL] I wish to display the filename after the file uploaded. The text in green are added by myself. However, I failed to display success status after the upload process successful. Do you know where I made the error?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Max's AJAX File Uploader</title>
<link href="style/style.css" rel="stylesheet" type="text/css" />
[Code]....
View 8 Replies
View Related
Jul 20, 2005
I have a series of pictures that are named as dates, example November 10th,
2003 would be 10102003.gif
Why does the following script fail?
<script language="JavaScript"> ....
View 6 Replies
View Related
Apr 26, 2005
Can I subtract the filename form the location.pathname ex:
Before = 'file:///c:/afolder/awebsite.html'
After = 'file:///c:/afolder/'
Or is there any other way to get the directory without the name of the file being veiwed?
View 1 Replies
View Related
Jun 17, 2007
This is a simple script I though of to get the filename of container for html.
Note: this only is tested on mozilla firefox 2 on windows vista
document.write("<a style='display:none' id='zFilenameFinder1' href=''>q</a>");
document.write("<a style='display:none' id='zFilenameFinder2' href='b'>q</a>");
var zDocURL = document.getElementById('zFilenameFinder1').href;
var zCompareURL = document.getElementById('zFilenameFinder2').href;
zCompareURL = zCompareURL.replace('b','');
var zFilename = zDocURL.replace(zCompareURL, '');
alert(zFilename)//filename handler
it works by creating two relative urls. one's href is blank, which when called by link.href returns the absolute value, giving the absolute link the page, then you compare it to a link that has a relative href of "b" which can be compared to the other link to give you the whole url
View 2 Replies
View Related
Feb 16, 2006
Is there a way to set the cookie filename with JS?
Currently it is setting it as 'asp/' (my directory). Can i specify it?
This is my code:
function setCookie(NameOfCookie, value, expiredays)
{
// Three variables are used to set the new cookie.
// The name of the cookie, the value to be stored,
// and finally the number of days until the cookie expires.
// The first lines in the function convert
// the number of days to a valid date.
var ExpireDate = new Date ();
ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 24 * 3600 * 1000));
// The next line stores the cookie, simply by assigning
// the values to the "document.cookie" object.
// Note the date is converted to Greenwich Mean time using
// the "toGMTstring()" function.
document.cookie = NameOfCookie + "=" + escape(value) +
((expiredays == null) ? "" : "; expires=" + ExpireDate.toGMTString());
}
and this is how i call it:
setCookie('OpenJaw', 'true', Ƈ');
View 2 Replies
View Related
Jun 8, 2010
I have recently come across the need for using the name of the image file within js, but I can't locate it. I am well versed in php, but my js skills are noticeably weak. About 25% of the way into the (partial) lightwindow.js I have placed a comment that shows where I need to access the current image filename.
Code:
This will stop image flickering in IE6 when elements with images are moved try
CODE:
View 8 Replies
View Related
Oct 18, 2010
I don't find something about this, but perhaps someone have a solution.
Below is my problem :
I overload standard document.write in order to defer some js calls ( like ads ) with a lazyload feature. [code]...
My question is : in my document.write overload, is there anyway to catch the filename of the js script that call the document.write ?
One precision : I've got no possibilities to change distant js files.
View 1 Replies
View Related
Jun 16, 2011
I'm using Joomla. I've got a dropdown which reads the filename from the database. When the user selects it I want an onchange event to open the pdf.I've been at it for 2 days now.
<?php
$con = mysql_connect('localhost', 'root', '');
if (!$con)
[code]....
View 6 Replies
View Related
Nov 14, 2010
how to save form values in cookies, etc. for use when re-displaying the forms. for example, after an error has been detected. Naturally, PHP allows you to do this with $_SESSION variables.
But no one seems to have cracked the problem with FORMs having file uploads. Browsers will send the file to the server and the name, but not the path on the client computer (I suppose for security reasons).
So, if you want to re-display the page, you can fill in all the form data in your PHP script so that the user doesn't have to re-enter everything. But, since your PHP script only knows the NAME of the uploaded file, and not the path, whatever your fill in for the "xxx" in <input type="file" value="xxx" /> will be wrong.
View 4 Replies
View Related
Sep 28, 2010
I have a webform that creates a word document as it's ouput (yes I know it only works on IE).
function createWordDoc(){
Doctxt = "some text here"
var w=new ActiveXObject("Word.Application");
w.Visible=true;
w.Documents.Add();
w.Selection.Font.Name="Times New Roman";
w.Selection.ParagraphFormat.Alignment = 1;
w.Selection.TypeText(Doctxt);
w.Documents.Save();
}
My issue is with saving the file. At the moment, in the above code, it opens the save dialogue box, and populates the filename field with the first line of text in the document. What I want to be able to do is populate the filename field with a variable filename created by the function. I've tried the snippet below, which works with the dynamic filename, but it autosaves the file to "My Documents" folder without prompting. I need to be able to allow the location to be changed.
var FileName = "Myfile.doc"
w.ActiveDocument.SaveAs(FileName);
View 1 Replies
View Related
Oct 11, 2011
I'm working on an internal website at work and employees have a cookie created when they login to the customer support tool. The filename is cookie:username@domain.com/ and I'd like to use javascript to pull a variable for their username to plug into a URL for a unique link when they're viewing one of our intranet pages.
@domain.com/ will always be the same but I don't know how to pull the unique username from the filename of the cookie. I don't need to actually read the cookie.
View 2 Replies
View Related
Aug 6, 2007
I am new to this forum, so your help would be most appreciated.
I am trying to create a javascript where, on clicking a button, I will
be able to download the latest log file. But the log filename changes
everyday as it takes the current date as part of the filename. eg.
EMEA_20070806 i.e. EMEA_yyyymmdd
Also, the previous day's log file is stored in the same directory.
How can I create a button where it will download the latest log file
at all times?
View 2 Replies
View Related
Feb 15, 2011
I am using the "Validation" plugin to validate my form. This is a multipart form where a user can upload a file. I would like to validate the choosen file name such that it contains only alphanumeric characters plus defined extensions. For that I tried the combination of the rules "accept" and "alphanumeric" but this does not work because the file name is the full path of the file name and it contains non alphanumeric characters as: C:umyDirectorymyFile.txt
regular expression which could tests that myFile is made only of alphanumeric characters ?
View 11 Replies
View Related
Apr 22, 2010
I have in my application input type file for uploading files. How can i do javascript validation to check if filename has special characters in it?
View 10 Replies
View Related
Mar 26, 2011
I need to put previous/next navigation button images on a lot of slides.If i am on slide 3 I'd like javascript to identify previous button as slide2.html and next button as slide4.html and so on
View 14 Replies
View Related
Apr 6, 2011
[How to fetch filename with extension from file path? The file path is like this.(E:/videos/India.avi). I want to fetch only India.avi from file path.how to do it in javascript?/]
View 2 Replies
View Related
Feb 9, 2006
I need to chop up a string to obtain just the filename of an image. Lets say the image source is /images/thumbs/image.jpg. Using the DOM I have the source of the image in a variable called 'source'.
What I want to do is manipulate it so that it just returns the file name image.jpg. How can I achieve this? I tried split() to see if I could split it into an array using the / as a separator, but this didn't work.
View 7 Replies
View Related
Jul 19, 2011
When at the root of a site, without specifying a filename, a usual default of index.html (or even .htm) is loaded; however index.html does not appear in the location.href or location.pathname properties - only what you see in the browser address bar. I only have access to client-side Javascript (no server-side stuff at all).
Is there a way of getting this default filename from client-side JavaScript?
View 4 Replies
View Related
May 18, 2011
I need a way to scroll to the end of the fileupload filename once that file has been selected with the browse button. So instead of seeing c:FolderNamefoldername, the user will see foldernamefilename.fileextension in that box.
View 6 Replies
View Related
Dec 20, 2010
I am currently developing a page which allows access to music on a server. This music is being streamed, but users are also able to download this music (assuming they have the license to do so). All of the music uploaded is of the .mp3 format, however they have no filetype extensions, and were not named using any particular naming convention. Because of this, I was hoping to change the filename (when a downloaded is initiated) to variables I have stored based on the current song.
I am currently simply opening a new page, in Chrome is looks like this: chrome.tabs.create({ "url": song.url })
Hit presents the user with a prompt to save the file, however, its default name is a random alphanumeric string with no extension, as per their file name on my server. Is there an easy way to do this without renaming all the music server side? I do have the variables song.title and song.artist setup!
Edit: Since this page is only for Chrome users, I listed the code I am using. I understand window.open and was originally using this. It functions the same, and if I need to revert back to using is instead, I shall.
View 3 Replies
View Related
Jun 22, 2011
I have the button on one of the page and whenever the user clicks on this button I would like to display the explorer and let the user picks the filename and want to get display the filename on other page.I can use the window.open() but I am not sure what is the parameters to pass into the window.open() to display the "explorer" and get the filename.
View 3 Replies
View Related
Sep 30, 2009
I'm passing the variables myTitle and myLink to form.php using javascript.
This is the way I'm doing it:
Code:
<a href='form.php?title=" + myTitle +"&link="+myLink+">Click me</a>
It's working great but sometimes myTitle and myLink contain the plus character (+). When this happens it's not passed. In the case of the title, it's just a problem of looks but in the case of the link, well, the link won't work without the character.
As an example if the title is: Laptop + Accessories What is passed is: Laptop Accessories
What can I do to pass also the plus character??
View 4 Replies
View Related
Apr 3, 2009
I am trying to load html stream directly into webbrowser in delphi. The html contains java script. It loads xml and xsl files and display the xml content in the web browser. I got an error, says access denied for the command xmlDoc.load(fname); If I save the html into a file, test.html, and double click it, it is fine, no problem. The code is actually copied from [URL].
[Code]...
View 1 Replies
View Related
Mar 26, 2010
I am working on a dropdown list of countries and I have two questions about the code below:
1. How do I pass the value of the getSelectedValue() function into a hidden html field, so that I can post it to PHP's $_POST array?
2. When I create two or more instances of the dropdown list (shipping and billing addresses) the value of one changes both values, when I echo out <span id="country">. What do I need to do to separate them, so that each getSelectedValue() is separate? I know I can only have one id=country per page, so how do I have multiple values that remain separate?
Code:
$(".dropdown dd ul a").click(function() {
var dl = $(this).closest("dl");
var dropID = dl.attr("id");
[Code]....
View 7 Replies
View Related