Do not use on any
shared computer
August 29, 2008 09:10pm pdt
 
[x]
Attachment Details

Change Text Area To Check Boxes Javascript

Tags: Javascript, Python, HTML, CSS
Hi,

I'm working on a website right now that is using CherryPy.  I'm doing everything by stages, so I have one stage for the actions, one stage for the objects, one stage for the relationships, and one stage for the themes.  Cherrypy allows you to fade between these without reloading pages.

The problem I'm having right now is I'm trying to add the theme stage.  The problem is, all the other ones are designated by a textarea, here is the html:

[CODE]
<div id='main'>

<div id='editor-wrap'>
<div id='editor'>
<div id='editor-main'>
<h2 class='actions'>Enter Actions</h2>
<h2 class='objects' style='display:none'>Enter Objects</h2>
<h2 class='relationships' style='display:none'>Enter Relationships</h2>
<h2 class='themes' style='display:none'>Enter Themes</h2>
<p class='hint'>separate elements with commas</p>

<textarea></textarea>
[/CODE]

Now, what I need to do is when the theme stage is called, change the textarea to a list of check boxes that I'm pulling from a mysql table.  Here is what the syntax looks like for the changing stages function, and the code for dynamically changing the next button, I figure it has to be something similar:

[CODE]
$('#editor-main').fadeOut("slow", function() {
            $('h2.' + oldstage).hide();
            $('h2.' + stage).show();
            var stagei = $.inArray(stage, stages);

            if (stage == 'actions') {
                  $('.prev').hide();
            }else{
                  $('.prev').attr("onclick", "changeStage('"+stages[stagei-1]+"')").show();
            }
            if (stage == 'checkout') {
                  $('.next').hide();
            }
            else{
                  $('.next')
                        .attr("onclick", "changeStage('"+stages[stagei+1]+"')")
                        .html(stage == 'themes' ? "FINISH &raquo;" : "NEXT &raquo;")
                        .show();
            }
[/CODE]

At the bottom there, inside the last else statement, where I do the .html conditional, I figure I can add something else to change the textarea into this mysql list of check boxes.

Any ideas?
Start your free trial to view this solution
Question Stats
Zone: Programming
Question Asked By: infinitusagnitio
Question Asked On: 06.27.2008
Participating Experts: 1
Points: 500
Views: 0
Translate:
Loading Advertisement...
 
[+][-]Author Comment by infinitusagnitio
Author Comment by infinitusagnitio:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by scrathcyboy

Rank: Guru

Expert Comment by scrathcyboy:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by infinitusagnitio
Author Comment by infinitusagnitio:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
20080723-EE-VQP-34 / EE_QW_2_20070628