473,770 Members | 6,105 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

mootools - dynamically load ajax content in accordian panel

Hi Everybody,

I'm just now learning javascript and I'm using mootools. What I want
to do is to dynamically load a php page into accordian panel 2,
depending on which radio button is selected in accordian panel 1.
Here is a simplified version of my code.

window.addEvent ('domready', function() {
var accordion = new Accordion('h3.a tStart', 'div.atStart', {
display: 0, //will open the 1st panel at start
opacity: false,
onActive: function(toggle r, element){
toggler.setStyl e('color', '#000000');
},

onBackground: function(toggle r, element){
toggler.setStyl e('color', '#222');
}
}, $('accordion')) ;
//Open Accordion Panels
$('next1').addE vent('click', function() {
accordion.displ ay(1);
});
$('next2').addE vent('click', function() {

accordion.displ ay(2);
//AjxCln();
});
$('next3').addE vent('click', function() {
accordion.displ ay(3);
});
$('next4').addE vent('click', function() {
accordion.displ ay(4);
});

$('prev1').addE vent('click', function() {
accordion.displ ay(0);
});
$('prev2').addE vent('click', function() {
accordion.displ ay(1);
});
$('prev3').addE vent('click', function() {
accordion.displ ay(2);
});
$('prev4').addE vent('click', function() {
accordion.displ ay(3);
});

});
function MM_jumpMenu(tar g,selObj,restor e){ //v3.0
eval(targ+".loc ation='"+selObj .options[selObj.selected Index].value
+"'");
if (restore) selObj.selected Index=0;
}

var accordion;
var accordionToggle rs;
var accordionConten ts;

window.onload = function() {
accordionToggle rs = document.getEle mentsByClassNam e('accToggler') ;

accordionToggle rs.each(functio n(toggler){
//remember the original color
toggler.origCol or = toggler.getStyl e('background-color');
//set the effect
toggler.fx = new Fx.Color(toggle r, 'background-color');
});

accordionConten ts = document.getEle mentsByClassNam e('accContent') ;

accordion = new Fx.Accordion(ac cordionTogglers , accordionConten ts,{
//when an element is opened change the background color to blue
onActive: function(toggle r){
toggler.fx.toCo lor('#6899CE');
},
onBackground: function(toggle r){
//change the background color to the original (green)
//color when another toggler is pressed
toggler.setStyl e('background-color', toggler.origCol or);
}
});
}

function AjxCln() {

//new code below for ajax
var showSuccess = new function(req){
alert(req);
};

//a GET request
//new XHR({method: 'get', onSucces: showSuccess}).s end('location/
myscript.php', 'answerme=1&q=t est');

//find out which radio button was checked

var a1 = document.getEle mentById('svc_t p_1').checked; //these are the
radio buttons, depending on which one is checked, I want the variable
PAGE to be a different number. The php file will determine what
content to show based on what $page is equal to!
var a2 = document.getEle mentById('svc_t p_2').checked;

if (a1 == true) {
var page = '1';
} elseif(a2 == true) {
var page = '2';
} else {

}


//POST ajax
new XHR({onSuccess: showSucces}).se nd('AJAX/step-2.php', 'page=' +
page);

//above code ajax
}
Jul 21 '08 #1
4 3785
On Jul 21, 10:29 am, ameshkin <amir.mesh...@g mail.comwrote:
Hi Everybody,

I'm just now learning javascript and I'm using mootools. What I want
to do is to dynamically load a php page into accordian panel 2,
depending on which radio button is selected in accordian panel 1.
Here is a simplified version of my code.
comp.lang.javas cript is the best place on the Internet for discussion
about JavaScript in general.

Questions specific to Mootools will likely best be answered on the
Mootools group

http://groups.google.com/group/mootools-users

Peter
Jul 21 '08 #2
On Jul 21, 11:16*am, Peter Michaux <petermich...@g mail.comwrote:
On Jul 21, 10:29 am, ameshkin <amir.mesh...@g mail.comwrote:
Hi Everybody,
I'm just now learning javascript and I'm using mootools. *What I want
to do is to dynamically load a php page into accordian panel 2,
depending on which radio button is selected in accordian panel 1.
Here is a simplified version of my code.

comp.lang.javas cript is the best place on the Internet for discussion
about JavaScript in general.

Questions specific to Mootools will likely best be answered on the
Mootools group

http://groups.google.com/group/mootools-users

Peter
Thank you
Jul 21 '08 #3
In comp.lang.javas cript message <274cfaa3-5154-4960-872d-fdf07dea701d@w1
g2000prk.google groups.com>, Mon, 21 Jul 2008 10:29:41, ameshkin
<am**********@g mail.composted:
>
if (a1 == true) {
var page = '1';
} elseif(a2 == true) {
var page = '2';
} else {

}
Anyone who thinks that == true is needed there should start learning
JavaScript again.

--
(c) John Stockton, nr London, UK. ?@merlyn.demon. co.uk Turnpike v6.05 MIME.
Web <URL:http://www.merlyn.demo n.co.uk/- FAQqish topics, acronyms & links;
Astro stuff via astron-1.htm, gravity0.htm ; quotings.htm, pascal.htm, etc.
No Encoding. Quotes before replies. Snip well. Write clearly. Don't Mail News.
Jul 22 '08 #4
Peter Michaux wrote:
On Jul 21, 10:29 am, ameshkin <amir.mesh...@g mail.comwrote:
>I'm just now learning javascript and I'm using mootools. What I want
to do is to dynamically load a php page into accordian panel 2,
depending on which radio button is selected in accordian panel 1.
Here is a simplified version of my code.

comp.lang.javas cript is the best place on the Internet for discussion
about JavaScript in general.

Questions specific to Mootools will likely best be answered on the
Mootools group

http://groups.google.com/group/mootools-users
Whereas "best" should be understood as "fitted to satisfy mootools users",
not "technicall y correct" or "tainted by a sufficient level of development
experience in the languages and field in question".
PointedEars
--
realism: HTML 4.01 Strict
evangelism: XHTML 1.0 Strict
madness: XHTML 1.1 as application/xhtml+xml
-- Bjoern Hoehrmann
Jul 22 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1801
by: A.Wussow | last post by:
Hi Everybody, i want to load dynamically content from some user controls (with forms, or some data-controls) using atlas. So i use an UpdatePanel for loading the user control into a placeholder. Using buttons for loading new content works fine. But i still want to use a function which is callable per javascript. I think this way is more flexable than using the Buttons, becaus every button needs it's own Sub-Routine. But i want to have...
7
2152
by: Nathan Sokalski | last post by:
I have a page which I dynamically add several usercontrols (*.ascx files) to using the following code: Public Sub Refresh() For Each section As DataRow In Me.GetSections().Rows CType(Me.FindControl("admin" & CStr(section("buttontext")).Replace(" ", "")), adminsection2).RefreshSection() Next End Sub
4
4275
by: Jean Ceugniet | last post by:
Hi, I just made my very first ajax form submitting. This works perfectly (myAjax01 is a variable external to this function). **************************** Code >> **************************** $("formRecherche").addEvent("submit", function(e) { /**
1
1307
by: saadkhan | last post by:
Hello, I am working Visual Web Developer 2008, I`v learned alot of things including AJAX control toolkit. I want to dynamically add AJAX control AccordianPanes in an 'Accordian' on a buttons click event. I`v done it but its creating a new accordian on each click. Please help me out in it!
2
1040
by: saadkhan | last post by:
Hello, I am working Visual Web Developer 2008, I`v learned alot of things including AJAX control toolkit. I want to dynamically add AJAX control AccordianPanes in an 'Accordian' on a buttons click event. I`v done it but its creating a new accordian on each click. Please help me out in it!
1
1944
by: =?Utf-8?B?c3RldmVuIHNjYWlmZQ==?= | last post by:
Hi I have been banging my head for a few days now with this issue. I have a page that has several update panels everything is working fine except for 1 thing. I am creating a sort of wizard that will build a form that I plan to save to a database On stage 2 I load a usercontrol an unspecified number of times depending on
7
6670
by: RichB | last post by:
I am trying to get to grips with the asp.net ajaxcontrol toolkit, and am trying to add a tabbed control to the page. I have no problems within the aspx file, and can dynamically manipulate a tabcontainer which has 1 panel already, however I want to try create the TabPanels dynamically. I followed the advice here: http://www.asp.net/learn/ajax-videos/video-156.aspx (3rd comment - Joe Stagner)
1
2139
by: E11esar | last post by:
Hi there. I have created an asp.net page with C# and have added two tabs using the respective AJAX control. I am trying to add a table within an AJAX Accordion control in the second tab but I am running into problems where the two accordian entries are not functioning correctly. If I don't use a table and just place some sample text within the accordian body then this works okay but once I add the table, the second accordion value appears on...
3
5286
by: somtabu | last post by:
Hello... I want to make nested accordian with the help of AJAX ACCORDIAN control. Please help...... Thank you.
0
9592
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10231
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10005
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8887
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7416
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6679
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5452
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3972
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2817
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.