This forum is no longer open and is for reading/searching only.

Please use our new MachForm Community Forum instead.

MachForm Community Forums » MachForm 3

Javascript to enlarge not working on image used with radio button


  1. munger
    Member

    I have a multiple choice field in which I am displaying images (color options) in the label tag for a user to choose from. I want to enlarge the image when a user does a mouseover on the image so they can see the color better before selecting an option. I have a sample of javascript working with a test form I created in my own html and everything works great. When I attempt to do the same exact thing using MachForm the image displays, however the javascript is not displaying the enlarged image on mouseover. I used the same exact code in both the MachForm I created as I did in the test form I created in html.

    The javascript I am using is taken from DynamicDrive and is called "Image w/ description tooltip v2.0" and can be seen here: http://www.dynamicdrive.com/dynamicindex4/imagetooltip.htm

    My test page is located here: http://test.soundproofcow.com/temp.html

    The javascript is installed properly and working fine. The only code I need to add to get it to fire is to add a rel="imgtip[0]" to the tag I want to use it with...for example: <img src="some_image.jpg">

    You can see that it works great on my test form, but does not work on the MachForm.

    Can anyone tell me how MachForm may be handling the code differently that this will not work? Or maybe an alternate method to achieving this?

    Thank you in advance for your time.
    Michael

    Posted 12 years ago #
  2. munger
    Member

    After doing a little digging my best guess is this isn't working on the MachForm because it displays using an iframe and is not accessing the javascript from the parent page.

    Does anyone know how I might be able to get this to work? Or maybe have an alternate method to achieve this capability?

    Thanks again in advance!
    Michael

    Posted 12 years ago #
  3. munger
    Member

    Ok...my intuitions were correct. All I had to do to solve this problem is to add the links for the .js and .css files I needed inside the <head> section of the MachForm /includes/view-functions.php file and crisis resolved.

    Thanks to anyone who may have been spending time working on this...and I hope this helps anyone else trying to accomplish the same task.

    Michael

    Posted 12 years ago #

RSS feed for this topic

Reply