JavaScript FileUpload Question...
Hi there!
I'm uploading a file using the JavaScript code below. Is it possible to change the default browse button, to for example an image? If not, can the uploading be done using another language?
...<INPUT TYPE="file" NAME="x">....
Best regards
Paul
Hi,
Check out this link.
http://developer.iplanet.com/docs/examples/java/file_uploading.html
Hope this helps.
Regards,
Roopasri Vittal
Developer Technical Support
Sun Microsystems
http://sun.com/developers/support
Similar Messages
-
Javascript opoup question?
My question is
in window.open() if i give resizable=no and scrollbars=no is working fine in IE but not working in mozilla
anyone can help?
Thank You,
Sreenu.Ggantinapalli wrote:
even specifying the width and height also it's not workingYou did something wrong.
This example works in all browsers here:
<html>
<head>
<title>Test</title>
</head>
<body>
<button onclick="window.open('http://google.com', 'test', 'width=500px, height=300px, resizeable=no, scrollbars=no')">test</button>
</body>
</html>And in the future please post Javascript related questions at a Javascript forum. This has nothing to do with JSF. There are JS forums at dynamicdrive.com and webdeveloper.com. -
I've been teaching myself Java on and off for the past couple years with the help of these forums and other tutorials. Now I've decided to take on a project that requires the use of HTML and Javascript and I can't seem to find the information I need. I was hoping that somebody from these forums could either answer my questions and/or point me in the right direction to find the answers.
The project is simple. I created an HTML window with an inputTextArea, an outputTextArea, and two buttons (Submit and Reset). When Submit is pressed I need the program to take the text from inputTextArea one line at a time, check the indexOf a string, and add tags at the beginning and end of the string if it meets certain criteria before appending it to outputTextArea.
I can (and have) written this very easily in Java but I can't seem to find the methods I need in Javascript. In java I use a java.io LineReader to read the inputTextArea.getText() one line at a time and then make the changes as needed. I actually can't even find a tutorial in Javascript that can explain how to take the text from inputTextArea and print it into outputTextArea.
So the main thing I need to know is how to read one line of text at a time from the inputTextArea. I think I can figure the rest out.That was actually my original thought when I started on the Java version of the program but I couldn't figure out how to enter the the carriage return in as a variable to be indexed. So it wasn't until after I found the LineReader that I was able to complete the Java version.
Is there some way to enter the carriage return in as a searchable variable? -
FileUpload, Question about FormsDecoder.getFormsDecoderVersion
Hello,
I have successfully tested the FileUpload example provided in OTN.
I would like to go a little further in my understanding, so I decided to manipulate the code...
With my questions, you may think that I'm pretty new in java !! (that's true !!! )
Here it is :
In form fileuploader.fmb, under trigger WHEN-NEW-FORM-INSTANCE, there is a command to retrieve the FormsDecoderVersion:
vcDecoderVersion := FormsDecoder.getFormsDecoderVersion;
I looked at file FormsDecoder.java, provided in the demo, and also around... and I haven't found any method called getFormsDecoderVersion....
Question 1 : I would like to understand why ?
Within Forms, I tried to import a jar, and noticed that Forms automatically creates a package/package body.
I noticed that when I don't import a jar (for instance FormsDecoder), the forms compiles successfully, and when I import FormsDecoder, then compilation fails (because it doesn't find getFormsDecoderVersion)...
Question 2 : When shall I import a jar into Forms developer ? Shall I think about something specific before importing a jar into Forms Developer ?
I hope that I'm clear enough...
Thanks a lot for your help,
Best Regards,
OlivierHi,
I figured out how to answer question 1.... I was too much focused on the java code, I forgot the library fileupload.pll
And as a consequence, I think I got the explanation for question 2....: Importing a jar, helps to automatically build a link between the jar and Forms.
Anyway, I still would like to understand why, when I import a jar for class FormsDecoder, I don't exactly get what I can find in the fileupload.pll .... (missing procedures/methods and also, not the same way to write the procedure body)...
Does this mean that I don't have the same version of the jar file ?I hope you can help me,
Olivier -
This is a question for people who have used/ worked on the
fileupload.fla file that comes with flash. I am trying to make a
remove button for the file. Right now it only has the browse
button, any help is really apprieciated. Thanks
RandyNo one has ever worked with this?
-
Hi,
I'm trying to use the commons-fileupload-1.1.jar file and I've placed it in my WEB-INF/lib folder. When I try to compile my java though, I get an error that reads: package org.apache.commons.fileupload does not exist. I'm importing like this:
import org.apache.commons.fileupload.DiskFileUpload;
I've searched for answers on this already but can't find anything. I don't know if I'm placing it in the wrong folder or what. I'm using Tomcat so I also tried placing the jar file in the common/lib and server/lib folders but neither solved the problem. I've read that I may need to set in my classpath, but I don't know how to do this. Any help is appreciated. ThanksI'm trying to use the commons-fileupload-1.1.jar
ar file and I've placed it in my WEB-INF/lib folder.
When I try to compile my java though, I get an error
r that reads: package
org.apache.commons.fileupload does not exist.
I'm importing like this:
import org.apache.commons.fileupload.DiskFileUpload;Placing the jar in the WEB-INF/lib is the correct thing to do. But this would take care of the runtime. For compilation, you HAVE to set the jar to the classpath.
javac -classpath "%CLASSPATH%;c:\Tomcat\MyApp\WEB-INF\lib\commons-fileupload-1.1.jar" MyClass.javaThis is how your command should look.
I would rather suggest you to use Ant and create a simple build script to take care of all the compilation and classpath part. -
Simple javascript APEX question
Hello,
I am new to oracle APEX and am trying to complete an application but have one small issue. I am using a barcode gun to check in servers and other hardware, and once it is scanned it sends an "enter" to add the next row in my Master-Detail form. The code i am using for this is : onkeydown="javascript:if(event.keyCode==13){event.keyCode=9;return event.keyCode}" This works fine, it takes my enter from the barcode and tabs it to the next line. However at a different part of the form I need to make it convert my enter to a tab, and then back to an enter. Essentially I need it so that I scan the barcode, it then submits an enter, which is converted to a tab, and then I want it to then use an enter key. I cannot get this to work. My java skills are lacking, and this is what I have come up with:
onkeydown="javascript:if(event.keyCode==13){event.keyCode=9;return event.keyCode;event.keyCode=13;return event.keyCode}" This is just not working, any ideas on what I can do?
Thanks
Aaronlet me clarify, I have a master detail app. basically, the master holds all the racks for a datacenter, and the details page holds all the hardware within each rack. this means i can click on rack A1, and then see all hardware within that rack. when I am creating a master record, i need it so that I can just scan the rack barcode and move on to the next one. The problem is, after typing in a rack name (not even with scanner) and pressing enter, it auto cancels my rack entry. I have tried changing text field to submit on enter, and even tried java to the dosumbit('Apply_changes_add') with no luck. The easiest way for me to implement this is to have it so that on this form element (rack_name), when you press enter, it converts to a tab (which moves the cursor to the (create rack button) and then presses enter (to submit this page). I agree that this may not be the best way of fixing this issue, but I have no other way of going about it. any suggestions?
-
IDCS2 Mac Javascript - colorSettings question
I have a script that works in MAC CS3 and CS4, but in CS2 this line breaks the script:
app.colorSettings.cmsSettingsPath = TheFile; // This works in CS3 and CS4
I get this error in CS2:
Javascript Error!
Error Number: 1
Error String: cmsSettingsPath
etc.
Does anyone know what I am doing wrong?
R,
JohnThanks for the information. Actually, I have this code in the file:
PathToFile += "IDCS2_WPC1.csf";
var TheFile = File(PathToFile);
app.colorSettings.cmsSettingsPath = TheFile; -
Hello,
I am working on this site where there are javascript
dropdowns for the user to use in navigating the site
one of them is Login. See below for the calls form the DHTML
which is an include from a different folder.
this.item0 = "Home"
this.item1 = "About"
this.item2 = "Atlas"
this.item3 = "Help"
this.item4 = "LOG IN"
What I want to accomplish is when the user is already logged
in, then this.item4 = "LOGIN" should change to "LOG OUT"
In my login page I am tracking the #session.loggedin# to know
if the user is logged in. In Javascript is there a way to create a
gobal variable that javascript can see in all pages to check for
values and decide if User is logged in. Please I need HELOThe cfml reference manual has an example. If you don't have
one, the internet does.
I should mention that this function became available with
version 7 of coldfusion. -
Javascript/html question about popup window title
I am displaying an uploaded pdf file using wpg_docload.download_file in a popup window (using javascript open).
How can I change the title of this popup window.Thanks to Jes (John Scott at shellprompt.net) for a solution for my version of this problem; set the Content-Disposition in the HTTP header to indicate your required filename. Example:
I have an 'On-Load - Before Header' process on the ApEx page I want to use 'host' my PDF document generator. The page is called from a popup JavaScript call, allowing us to rely on ApEx authorisation and authentication. The Source of this process looks like the following:
declare
myblob blob;
begin
-- Call procedure to gereate PDF document in a blob and pass it back
myprocedure_to_generate_blob( in_parameter, in_parameter, myblob);
owa_util.mime_header('application/pdf',false);
htp.p('Content-Length: ;||dbms_lob.getlength(myblob));
-- This line sets the filename (which could be dynamic)
htp.p('Content-Disposition: attachment;filename=mypdffile.pdf');
owa_util.http_header_close;
wpg_docload.download_file(myblob);
-- Stop Apex from trying to render more of the page (we've finished)
htmldb_application.g_unrecoverable_error := true;
end; -
In a JavaScript function call can I do a callablestatement or a preparedstatement? I have a button onClick that I want to call a function and in that function I want it to send 2 input values to a callablestatment but not sure how or the best way to do this.
JavaScript is not Java.
But assuming you are talking about initiating a server side request that does prepared statements from the use of a client side button, you could make an AJAX request.
If you are talking about an embedded JavaScript engine in a Java application then you would do it the same way you call any Java from JavaScript when using it as a scripting enigne. -
JavaScript event question...
Hello,
I'm trying to write some JavaScript code that executes when an entry is selected from a Popup LOV. But because the item and it's corresponding hidden item are populated from JavaScript on the child page, it doesn't seem to trigger a change/focus event.
One way I've thought about overcoming this, but not yet tried, it to create a new Popup LOV template and locally override the JavaScript function with the same code + a little something I need.
Is there a better solution?
Regards,
Dan
http://danielmcghan.us
http://sourceforge.net/projects/tapigenTyson,
Nah, this seems to be a problem related to jQuery. The inline JavaScript worked but jQuery is not picking up on the change. In any case, just using the inline statement solves the issue for now and I opened a ticket with jQuery.
Thanks again.
Regards,
Dan
http://danielmcghan.us
http://sourceforge.net/projects/tapigen -
About use mouse middle key to call JavaScript function question
I want use mouse middle key to call JavaScript function (<a href="javascript:help()">) help() will open a new Window and direct to my GUI Help Page but when I click it with middle key ,it will open new Tab blank Page that url="javascript:help()"; can not Executive help function... Is this a Firefox Bug or correct behavior in Firefox? thank.
You need to use a left click to handle JavaScript links.
See also http://kb.mozillazine.org/browser.link.open_newwindow.restriction -
I have a cf form with <cfinput type=text
name="dateArrived" value="#dateformat(now(), 'mm/dd/yyyy')#"
onBlur="validateForm(initiateForm)">
When the form is first loaded, I display todays date but they
have the option of changing it. The only requirement is that the
date cannot be greater than today.
I call the following javascript function to try and check to
make sure the date entered is not greater than todays date (there
is other javascript code to check for valid date formats, requried
entry etc. :
function validateForm(initiateForm){
var returnStatus = true;
var today = new Date();
if (initiateForm.dateArrived.value > today)
alert("greater datea");
initiateForm.dateArrived.focus();
returnStatus(false);
But I keep getting a object error. I think I have everything
defined but obviously not. What am I doing wrong and do I need this
in its own function ? Seems simple enought but it will not work for
me.I tried to modify my javascript code to check for the date,
and radio button and checkboxes included, and now nothing is being
called. When I submit, nothing is valideded and the form submits.
What did I do to butcher it ?
<Script language="JavaScript">
function validateForm()
var currentTime = new Date()
var month = currentTime.getMonth() + 1
var day = currentTime.getDate()
var year = currentTime.getFullYear()
var todaydate = month + "/" + day + "/" + year
if(document.initiateForm.dateArrived.value > todaysdate)
alert('Date Arrived cannot be greater than today.');
initiateForm.dateArrived.focus();
return(false);
if (document.initiateForm.dateArrived.value == "")
alert("Please enter the date arrived.");
document.initiateForm.dateArrived.focus();
returnStatus(false);
myOption = -1;
for (i=document.initiateForm.siteID.length-1; i > -1;
i--) {
if (document.initiateForm.siteID
.checked) {
myOption = i; i = -1;
if (myOption == -1) {
alert("Please select a site.");
returnStatus(false);
myOption = -1;
for (i=document.initiateForm.errorID.length-1; i > -1;
i--) {
if (document.initiateForm.errorID.checked) {
myOption = i; i = -1;
if (myOption == -1) {
alert("Please select at least one error description.");
returnStatus(false);
if (document.initiateForm.errorID["7"].checked &&
initiateForm.comments.value == "")
alert ("Comments are required.");
document.initiateForm.comments.focus();
returnStatus(false);
if (document.initiateForm.comments.value.length > 400)
alert ("Comments cannot be more than 400 characters.");
document.initiateForm.comments.focus();
returnStatus(false);
return(true);
</Script> -
JavaScript Date Question ??
Hi -
I am using Portal 3.0.9. I have a form with field "A" which is date type defaulted to sysdate.
I have another field "B" which I want to be defaulted to "A+7". I am not a JavaScript Guru.
I would appreciate any help
Thanks in Advance.
Fahimok, this is what you need to do:
The onBlur event for A will be called when the textbox A loses focus, so this is where the code should go. "this.value" will give you the value entered in A. The way to reference B is document.forms[0].elements[whatever number B is]
So your code would look something like this:
document.forms[0].elements[11].value=this.value;
Of course you will need some logic to increment the date by 7 days. A search in google got me this: http://javascript.about.com/library/scripts/bldatemath.htm
Hope this works for you,
hsiu
Maybe you are looking for
-
Need help with this xml gallery !!!
i have build a gallery but its very simple...... it takes images from xml file. i have attached all files in zip. i just want two things if anyone can help. first when i press next button it goes to next image but with no effect. it just displays nex
-
How to extract sub string value from a string?
Hi, I need to know how can i extract sub strings from a main string, something like this: main variable-------->"2087-5E2SE-19-JG7BC" i want to split it into like this: sub_main_1 variable---------> "2087" sub_main_2 variable---------> "5E2SE" sub_ma
-
Date in File name is importing date, not shooting date
Lightroom 2.0 on Windows XP I always used the model (in the french version) "{Nom de fichier>>}_{Date (AAAAMMJJ)>>}" for importing my images (RAW files from Nikon D50, option "convert to DNG"). It gave me names like _DSC8347_20080715 for a picture wh
-
WebDAV item versions access in 9.0.2
For our portal usage, webDAV is a good way to provide a simple way to update documents stored in the portal. However, item versioning management through webDAV should be improved/fixed. A. In case of "simple item versioning", the default behaviour ca
-
Userspecific Printer determination for orders / invoices
Hello SD-experts, At the moment output types are found via condition records, based on sales org / sales unit. These condition records contain the printing parameters. The requirement now is that for some users the parameters should be userspecific.