...was asked for some php file upload code, so I thought I would post some stripped down, barebones code that I use in admin/dashboard pages to add/change images associated with products. Please see attached image for folder setup. The code uses the [jQuery Form](http://malsup.com/jquery/form/) plugin by Mike Alsup. **index.php** has two forms; one for the image uploads and the other to show where you would have your "product add/update" form. Files are immediately uploaded to a tmp directory whenever you select an image. If you change your mind a few times you can end up with lots of images in …

Member Avatar
Member Avatar
+1 forum 8

In response to [this thread](https://www.daniweb.com/programming/web-development/threads/499762/jquery-for-dropdown-textbox) I've decided to paste the linked example as a code snippet (updated to html5/jQuery2).

Member Avatar
Member Avatar
+2 forum 1

A while back, I was working on some web pages that required a tabbed menu at the top of the content. In addition, the requirement was that the page should not perform a post back when the user clicked on the individual tabs. It was very important to have a simple, clean, and responsive look and feel. I could have used one of the countless examples found on the Internet, but I wanted to use implement something that was very minimal, clean, and simple. I was not happy with what I found out there. So this is what I came …

Member Avatar
+2 forum 0

When users interact with your web page and processes, it is important to provide them with continuous feedback. Without the feedback, a user is left wondering if you page is actually processing work, frozen, or just not working. This is especially true when incorporating Ajax requests that take more than a few seconds for the process to complete successfully. For this reason, you will find that "spinners" or "progress bars" are used to display what seems to be the browser performing some work in the background. In reality, all that is really happening behind the scenes is that the web …

Member Avatar
+2 forum 0

Hello All. Been playing around with some linked dropdowns. It seems to be a recurring theme here on DW, so I thought I'd offer this up as a possible solution or for discussion, to see how it could be improved. The premise for this set of linked dropdowns is that it is not dependent on php or Ajax following page load, that is to say, all the data is initially dumped into json format from the database and then everything is left to javascript. I've used jQuery to produce a plugin, but the same functionality is possible with just plain …

Member Avatar
Member Avatar
+5 forum 3

**// EDIT 2014-04-07 //** New version (1.0.3) posted at the [bottom](http://www.daniweb.com/web-development/php/code/476623/ajaxed-linked-dropdowns-select-fields-for-volatile-data#post2082327) Demo Page: http://demos.diafol.org/ajax-linked-dropdowns.php *********************************************** Hello All. Been playing around with more linked dropdowns (select form fields), following the code snippet posted for static-ish data [here](http://www.daniweb.com/web-development/php/code/475238/linked-dropdowns-select-fields-for-static-ish-data). The static-ish version is of limited use (or of no use!) if data in the DB is updated regularly. So, here goes... No data is loaded by PHP initially, everything is provided through an Ajax call, however, that could be easily modified if required. I've used jQuery once again, as my plain javascript skills just aren't up to the job, and have produced a …

Member Avatar
Member Avatar
+3 forum 4

Hi, I thought I'd share this with you. If you want all fields on a web form to be emptied of ther initial value (if any) on focus and filled again with the initial value on blur. Works with jquery.

Member Avatar
Member Avatar
+0 forum 1

Tablesorter (currently v2.0.5) includes an "update" method. This method keeps a Tablesorter object up to date with dynamic changes made to its table(s). Like other Tablesorter methods "update" is implemented in the form of a custom event. A typical method call would be $table.trigger("update"); , where $table is a jQuery object. For some reason unknown to me, the "update" event code is written inside a setTimeout(function(){...}, 1) structure. Presumably this overcomes a problem in some browser or other. This works fine within itself but means that statement(s) immediately following a .trigger("update") call will be executed before the "update". This is …

Member Avatar
Member Avatar
+0 forum 8

I just made this code today for a site I'm working on and figured people may try to improve it. To use: [CODE] $("#randomize").randomize(); [/CODE] [CODE=HTML] <!DOCTYPE HTML> <html> <head> <title>Random Pick Test</title> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.js"></script> <script type="text/javascript" src="randomize.jQuery.js"></script> <script type="text/javascript"> $(document).ready(function() { $("#randomize").randomize({ direction: 'topToBottom', evenBG: '#FFF', evenFG: '#000', oddBG: '#AAA', oddFG: '#444' }); }); </script> </head> <body> <div id="randomize"> <span><a href="#1">Child 1</a></span> <span><a href="#2">Child 2</a></span> <span><a href="#3">Child 3</a></span> <span><a href="#4">Child 4</a></span> <span><a href="#5">Child 5</a></span> <span><a href="#6">Child 6</a></span> <span><a href="#7">Child 7</a></span> <span><a href="#8">Child 8</a></span> <span><a href="#9">Child 9</a></span> <span><a href="#10">Child 10</a></span> </div> </body> </html> [/CODE] [CODE=CSS] /* style.css */ #container …

Member Avatar
Member Avatar
+0 forum 1

This is Jquery plugin which can be used to change the content a its place. Features: 1. Easy to use 2. Maintain changeability of Jquery Know Issue: 1. Can take html string also as input For example: html: [code=html] <div id="editable">I can be changed right here</div> [/code] javascript: [code=javascritp] $.('#editable').editAtPlace(function(newtext, oldtext) { alert("Old Text: " + oldtext + " New Text: " + newtext); }); [/code]

Member Avatar
+0 forum 0

In my current project we need to provide drag&drop functionality of items from left to right and vice-versa and on click of the button send array of item IDs to server. Main problem was that we couldn't get array across to server and online examples that we found did not work. Above snippet will grab "id" attribute of all list elements (order/unorder list) from container with ID of "sortable2". Push IDs from listed elements to array "ids". After that, it will get currently selected value from drop down menu and store it in "id" variable that is used in next …

Member Avatar
+2 forum 0

The End.