• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using Javascript to set dynamic value for forms

#11
[eluser]TheFuzzy0ne[/eluser]
Oh, and I also have a suggestion on an alternative way to go about allowing users to upload photos.

I have a photo album, and the first thing I allow users to do, is to select any images for upload. Once images are uploaded, they are not made public. On the next page, the user can see a preview of the images they've uploaded, and has the opportunity to publish/delete them, and also to add a caption. I find that this can help when users don't know how to give themselves a thumbnail view of the images they want to upload in the file selection dialog, and makes it easier to ensure they've uploaded the images they wanted to. I have a Flash-based uploader which automatically uploads images as they select them, but if they don't have Flash or Javascript enabled, they can still upload files with an extra button click.

Just wanted to put that out there. Smile

#12
[eluser]boltsabre[/eluser]
One other thing... please don't code your JS like you have with variable name starting with the dollar sign, it's a MASSIVE code smell and it's just going to cause you problems in the long run... I found it hard to even read it, my brain kept going into PHP mode even though it I mentally knew it was JS code!!!

And you should consider looking into using a JS framework like jQuery, it makes your code even more readable once you get used to it. It also means you can code the same functionality with about 1/3 of the code, meaning you have a 66% less chance of coding a bug ;-)


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.