In my ASP.NET MVC application, I am trying to put together a page where a user can both sign and print their name once at a workstation equipped with a Wacom. The signatures will be saved to PNGs with links in a database and then stamped in the designated area of each form, upon user approval. With just one signature canvas, the process works flawlessly.
But even with 2 separate Javascript files, I can get one canvas working fine, but cannot get the other canvas to draw.
If I split the canvases onto 2 different pages, they each work fine separately. I can do that, but would rather have them both on one page.
I know I am missing something regarding Javascript or canvas, probably simple, but I don't know what it is.
Here is the Plunker: http://plnkr.co/edit/FsFUxIFdNUyNmluLAZJn
IndyItMan
0
Newbie Poster
Recommended Answers
Jump to PostYour JavaScripts are over-writing each other. Wrap them in anynomous functions, like so :
http://plnkr.co/edit/B6265864pZhZOsXGkBqL?p=preview
Basically, you want to wrap your entire JS in
(function(){ ..... your code ..... })(); …
Jump to PostOh my - I haven't looked at that yet - I can tomorrow, it's midnight here in South Africa and I get up at 04:50am!
Jump to PostWhat is very interesting is that with http://plnkr.co/edit/0CTsA0Co4CBatiluSEwA?p=preview, I get to see that the canvas is cleared, but then something ELSE happens! That is the cause of the failure, I am missing something …
All 9 Replies
Ewald Horn
26
Newbie Poster
IndyItMan
0
Newbie Poster
Ewald Horn
26
Newbie Poster
IndyItMan
0
Newbie Poster
IndyItMan
0
Newbie Poster
IndyItMan
0
Newbie Poster
Ewald Horn
26
Newbie Poster
IndyItMan
0
Newbie Poster
Ewald Horn
26
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.