Welcome, Guest. Please login or register.
Did you miss your activation email?
March 22, 2010, 08:28:50 AM

Pages: [1]
  Print  
Author Topic: Calling widget via javascript function for image button - needs help  (Read 187 times)
laurenell
Newbie
*
Posts: 4


« on: January 27, 2010, 12:49:24 PM »

Okay, I'm not great at javascript and would love some help.

What I'd like:

Graphic button on webpage.  Click it and it turns on a relay.

What I did, in the head I have:

function on()
{
    widgetSetState('ID', 1);

}  

This works fine, what doesn't work is the following.  It's quite strange, sometimes it actually works, but the next time it won't.

<FORM>
  <p>
    <INPUT TYPE="image" src="yes.jpg" name="yes" onclick="yes()" >
  </p>

I'm sure I've done something stupid - so any help?
</FORM>
« Last Edit: January 27, 2010, 01:10:45 PM by laurenell » Logged
iobridge
Administrator
Sr. Member
*****
Posts: 413



WWW
« Reply #1 on: January 27, 2010, 01:06:05 PM »

Try:

onClick

Also, do you mean...?

onClick="on()"



Logged

ioBridge Support
Community Team
laurenell
Newbie
*
Posts: 4


« Reply #2 on: January 27, 2010, 05:57:09 PM »

well, still no luck - you were right though I did mean 'on', thanks for the help, I think I'll just not use a form, since I got this to work fine:



<a href="#" onclick="on()"><img src="on.jpg" border="" /></a>

« Last Edit: January 27, 2010, 06:07:13 PM by laurenell » Logged
Pages: [1]
  Print  
 
Jump to:  



 
Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC
| © ioBridge Corporation | RSS Feed