adding multiple files on page with file attribute - javascript

I wanted to have one single input type of file to add multiple files on page and found below code from: http://the-stickman.com/web-development/javascript/upload-multiple-files-with-a-single-file-element/
but i am pretty new to JavaScript and having issue to extend it, what I need is when it add file to page it should add a new input of type text where I can pass title for that file .
I tried this but its showing me a pop-up window when I add a new file element and input is not beside file.
http://jsfiddle.net/4JPzL/
Below an image example how I wants it to look like
Thanks for any help.
EDIT FIX:
Never mind i have fixed it here (cant answer my own question so here it goes...):
http://jsfiddle.net/4JPzL/2/
Regards

Never mind i have fixed it here:
http://jsfiddle.net/4JPzL/2/

Related

Html form to local xml file

I'm trying to make a simple form that adds user input to a local xml file. Basically, I need to input a name and a proffesion.
The xml file looks something like this:
<mainNode>
<name>Jeff</name>
<proffesion>Dog Trainer</proffesion>
</mainNode>
But I need some method (either with jQuery or javascript) to populate or add to the existing file (example.xml) using that form instead of creating a new xml file or replacing the nodes. I would show I've tried so far, but i've tried so many examples I can't even decide what to show (but if necessary I'll edit this post ). Any help or pointing in the right direction would be appreciated, thanks ! :)

How to remove the functionality of printing in the file viewer.js on Prebuilt Pdfjs from mozilla?

How to remove the functionality of printing in the file viewer.js on Prebuilt Pdfjs from mozilla?
In this file, too much code(~10K) and I can not understand, how there it is implemented. Help please, at least explain how it is in this file is implemented. Advance thanks.
Since, removing or commenting out the HTML element throws error, remove or comment the following lines from viewer.js to remove Print, Download, Open features (you can also remove any one of these since you only need to remove print):
eventBus.on('beforeprint', _boundEvents.beforePrint);
eventBus.on('afterprint', _boundEvents.afterPrint);
eventBus.on('openfile', webViewerOpenFile);
eventBus.on('print', webViewerPrint);
eventBus.on('download', webViewerDownload);
And as a precuation I would suggest disabling the document property request by disabling the concerned event too, so remove or comment
eventBus.on('documentproperties', webViewerDocumentProperties);
For being on the safe side, also remove or comment the eventBus.off for each of the events above. For example:
eventBus.off('print', webViewerPrint);
I couldn't tell you the line numbers of these codes exactly since my viewer.js has been modified beyond restoration to it's original form.
Finally, add hidden attribute to the HTML elements or figure out some other way to hide it, but whatever you do, do not remove or comment the HTML elements.

Proper usage of <script language="javascript" type="text/javascript">

So, Im currently developing a prototype system for a requirement in my degree.
My question is how do you use the code ? it seems like it only caters to one html file that I originally coded it.
To be more specific:
I already called the code to power my real time calendar and clock for this specific schedule.html file
I used the same line to another adddate.html file to produce a confirm box but for some reason the confirmation box is working on the schedule.html file not in the adddate.html file
can anyone help? please go easy on me im still learning its only been 1 and half weeks of coding...
FAQS:
Yes, They are in the same file folder for anchor href purposes (prototype still)
No, I haven't read everything there is to know about javascripting (sorry...)
thanks in advance!
If you are writing the js code inline all you need is
<script>
// code goes here
</script>
Otherwise you need the source (src) attribute if you are pointing to a file
<script src="/file-name.js"></script>
Javascript is the default so you don't need the type or language attributes. Also the src attribute is the relative location so if you need to change directories, ../directory/file-name.js - as an example.
Hope that helps.

How to make imageflow to link to content or product using drupal views

I've created a view, added the specific path and used 'rewrite results' to output the field as a link > path. This gives me the intended HTML view format. When I change to imageflow and one of the images, the behavior changes to open a larger version of the image (imageflow default behavior).
As I see it, it's an imageflow overwrite, and the plugin allows you to set an onClick parameter. I'm trying different values to try to make it link to content. This tends to break imageflow or not link at all.
Any similar experience or suggestions?
What is the kind of your field? Image, title?
Link the field to its node and then use this code inside the "OnClick Override" settings:
function() {window.open(this.url, '_blank');} // Or _parent to open it normally
The solution found was to use a different Drupal module jQFX. The links work without the need of the onClick statement. Unfortunately, the option reflex doesn't seem to work.

Multiple image upload without flash

I want to use HTML and PHP for 9 or more images upload. The problem is that I don't want 9 upload fields because it looks bad. Does anybody have any suggestions ? Maybe examples ?
Thanks.
I've been using noSWFUpload for some time and it works pretty good. It relies on XMLHttpRequest's sendAsBinary in supporting clients and falls back to iframe-based submission.
http://the-stickman.com/web-development/javascript/upload-multiple-files-with-a-single-file-element/
Connect to the fileInput's onchange event, hide it, get the value and add it to a textarea, and create another. Name them all the same plus an increment: field1, field2... Loop through the field names in PHP and check for existance with isset.
Or use Dojo's FileUploader and force html:
http://docs.dojocampus.org/dojox/form/FileUploader
What I have done in the past is to give an option on doing another upload, or, when they pick the first file, display it as a label, then have another box ready for them to pick another file. Each file input is actually with a unique name, so the server just goes through until it doesn't find the next file.
But, this requires a bit of javascripting. :)

Categories

Resources