Basic JavaScripting - Adding a color picker
If you've been learning and using FileMaker for any amount of time, then you'll likely know that FileMaker also has access to JavaScript. It does this through the Web Viewer object which can easily be added to any layout.
For some FileMaker developer's they may answer the question of "Why don't you know/learn Javascript?" with a response of it either being too hard or not being able to take the time to learn it. It' only when FileMaker can't do what what needs to be done when some developers start to look outside of FileMaker's core set of available tools.
The cool thing about JavaScript is that like many tools, it can do a variety of things better than FileMaker alone. I've never come across a single tool which can do it all the best way possible.
If you've never implemented any JavaScript within your FileMaker solution, then this video may be the best way to start that journey. The implementation of a JavaScript based color picker is so easy you'll be craving more and more JavaScript by the end of the video. Whether you need a color picker or the ability to draw content on top of an image file, JavaScript will offer a lot more extensibility than just sticking it out with FileMaker alone!
Comments
Attachment link not working for subscribers
I logged in as a subscriber and when I try to download the BasicJavascripting.zip file I get a message that the file can only be downloaded by subscribers.
Thanks - fixed
Sorry about that.
Links for videos not working
The links for the videos are still not working.
____________________
Rick Stringer
Rick Stringer Creative Services, LLC
www.rickstringer.com
Twitter: http://twitter.com/rick_stringer
Facebook: https://www.facebook.com/RickStringerCreativeServicesLLC
Issues with videos
There is an issue with the web site that videos will occasionally become not available when the server side cache is not updated. I'm trying to work on a fix for that.
Downloading videos
Any progress on this? Is there a time of day or day of the week when it's more likely that the video downloads will work?
Katherine
www.makepopupcards.com
rob function
Just a little note.
You say (@33:38) that the FileMaker rgb function works as well with commas as with semicolons.
But apparently not in our part of the world (Belgium, Dutch speaking part).
Substituting the commas (as in "TextColor ( Javascript::name ; Evaluate ( Substitute ( Get ( ScriptParameter ); ","; ";" ) ) )" does the trick.
Luc
Substitute commas with semicolons in return string
Thanks, Matt.
Excellent as always.
I had the same issue with commas as Luc here in Norway, but I chose to make the substitution in the Javascript itself.
window.location = 'fmp://$/Basic%20Javascripting?script=Runme¶m=' + encodeURI(color.toRgbString().replace(/\,/g,";"));
Glad you guys found the fix
Yes, you can always run the substitution in either JavaScript or within FileMaker. Thanks for posting the solution for other!