views:

164

answers:

1

Hi, I am a Javascript/jQuery/Prototype newcomer and I have a page that has a Prototype function to get info from a database and put it into some input fields. This was made before I came to work on this site and now I've been asked to add a hide/show div function.

I tried it in jQuery and there were clashes with the two frameworks, (as found in my previous question).

My question now is, how would I go about building a show/hide function in Prototype? I think it will be easier to do it this way than to re-build the info grabber.

The page I want to add this to is here. (the green "ny kunde" button should show the div directly but one below it newCustomer.

I found this resource: Hide show div with Prototype but I have no idea on how to implement it.

Thanks. :)

+2  A: 

You can use jQuery by following these instructions to stop from clashing with other libraries.

Prototype provides the Element.hide() and Element.show() methods which means you can hide a div with ID #hello with:

$('hello').hide();
Charlie Somerville
Thanks! Worked absolutely perfectly!
Kyle Sevenoaks