AleMonteiro 238 Can I pick my title?

Hi, this feature could be use to discart some unwanted objects, after some filtering perhaps.

But I think the point is that JS is a very dynamic language, we can change almost anything at anytime.

In example, here's a strange thing to do, but it works:

<div id="test"></div>

<script type='text/javascript'>

alert(document.getElementById("test"));

document.getElementById = function(id) {
    alert("I don't want to find " + id);
    return undefined;
}

alert(document.getElementById("test"));

</script>
AleMonteiro 238 Can I pick my title?

Hi, I didn't look for the problem in your code, but I made an example in my way:

     <!DOCTYPE html>
    <html>
    <head>
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">

     <script type='text/javascript' src='http://code.jquery.com/jquery-1.4.4.min.js'></script>

      <style type='text/css'>

      </style>

    <script language="javascript">

    $(document).ready(function() {
        $('#txtarea').change(function() {

            // Create options for origin
            var optionsOrigin = [
                [0, 'Select'],
                [1, 'NAIA 1'],
                [2, 'NAIA 2'],
                [3, 'NAIA 3']
            ];

            // Create options for destination
            var optionsDestination = [
                [0, 'Select'],
                [15, 'NAIA 1'],
                [16, 'NAIA 2'],
                [18, 'NAIA 3']
            ];

            // Create options for vehicle
            var optionsVehicle = [
                [0, 'Select'],
                [9, 'Toyota VIOS 1.3 MT'],
                [10, 'Toyota VIOS 1300 E AT'],
                [11, 'Toyota VIOS 1500 G AT']
            ];


            /*

            if ($(this).val() == "1") { 
                optionsOrigin = ...
                optionsDestination = ...
            }
            else if ...

            */

            // Set the options to the selects
            $("#txtorigin").setOptions(optionsOrigin);
            $("#txtdestination").setOptions(optionsDestination);
            $("#txtvehicle").setOptions(optionsVehicle);
        });
    });

    // Validate Form
    function validate()
    {
        if ($("#txtarea").selectedIndex() < 1)
        {
          alert("Please select area");
          return false;
        }  

        if ($("#txtorigin").selectedIndex() < 1)
        {
          alert("Please select origin");
          return false;
        }

        if ($("#txtdestination").selectedIndex() < 1)
        {
          alert("Please select destination");
          return false;
         }   


        if ($("#txtvehicle").selectedIndex() < 1)
          {
          alert("Please select vehicle");
          return false;
          }               
    }

    // Extends JQuery
    (function ($)
    {
        $.fn.extend({

            // Set array de options to select
            setOptions: function (options)
            {
                $(this).each(function ()
                {
                    $(this).empty();

                    if (options != undefined && options != null)
                    {
                        var tmpHtml = "";
                        for (var i = 0; i < options.length; i++)
                        {
                            var item = options[i];
                            tmpHtml += '<option value="' + item[0] + '">'+ …
AleMonteiro 238 Can I pick my title?

May I suggest EPPlus?

It's a c# open source project for reading and writting excel files. It's quite simple to use and have a good documentation. The only setback, as far I'm concerned untill now, is that it only accepts xlsx(excel 2007 or later).

AleMonteiro 238 Can I pick my title?

Hi.

Here it's working: http://jsfiddle.net/3MwXd/17/

The problem: you add the 'change' listener each time the <td> is clicked. That means that the second time you click, the input will have 2 listeners. The third time, 3 listeners, and so on.
The solution(not changing much of your code) is to unbind the change event before adding a new one.

And about adding click listener on dynamic rows, an example:

$("#myTable").append("<tr><td>test</td></tr>");
$("#myTable").find("tr").click(function(){...});

OR

$("<tr><td>test</td></tr>")
    .click(function(){...})
    .appendTo("#myTable");

(I didn't test it, but both should work)

Hope it helps.

AleMonteiro 238 Can I pick my title?

I really didn't read all your code, but I think this is the idea you are looking for:

var images = ['img1', 'img2', 'img3', 'img4']; // 4 images
var timeMin = 5000; // 5s
var timeMax = 10000; // 10s

$(function(){   
    changeImage();
});

function changeImage() {
    var imgIndex = getRandom(0, images.length-1);
    var time = getRandom(timeMin, timeMax);     
    $("#test").append("<p>Image changed to <b>" + images[imgIndex] + "</b>. Next change in <b>" + time + "ms<b/></p>");
    setTimeout(changeImage, time);
}

function getRandom(min, max)  {
    var r = Math.floor((Math.random()*(max-min))+min);
    //$("#test").append("<p>getRandom(" + min + ", " + max +") = " + r + "</p>");
    return r;
}

#test is just a div to display the log

AleMonteiro 238 Can I pick my title?

try this:

var markerId = $(this).children().eq(0).attr("rel");
Danny159 commented: thanks +2
AleMonteiro 238 Can I pick my title?

I think you're missunderstaing somethings...
First, you are not using the array as an array, but as an simple object(var array = new Object() would be prettier).
Second, pepsi is not a property of "array.drinks", it's the value.
What I think you want:

var array = new Object();

array.fruit= ["banana", "apple"];
array.vegies = ["cucumber", "carrot", "tomatos", "potatos"];
array.drinks = ["coke", "pepsi"];

outerloop:
for(var prop in array){
    var obj = array[prop];

    for(var index in obj) {
        var val = obj[index];
        if ( val == "pepsi" ){
            alert(val + " found");
            break outerloop;
        }
    }
 }

Hope it helps.

AleMonteiro 238 Can I pick my title?
AleMonteiro 238 Can I pick my title?
AleMonteiro 238 Can I pick my title?

Vizz,

according to the sepecs of the jquery rotate plugin: it supports images. No where says it supposed to work with divs.

Try using the rotate with an image in IE and see if it works.

AleMonteiro 238 Can I pick my title?

Hi rapidwein,

your code has a lot of errors, in the javascript and also in the html.

On the html:

  • There's a lot of

<

p> tags that has no closing tag. You shold remove all of those, because they are not used and might will cause problem because the syntax is invalid.
* Some divs have # on the ID, remove them.
* All radio buttons have the same name, this means that you can only select of radio button. The names should be equal per question, so you can select one radio for each question.

The javascript i already fixed the syntax, use this:

function Init()
{
    var arrDivs = new Array('1','2','3','4','5','6','7','8','9','10');
    for(var j=0;j<10;j++)
    {
        var chosenDiv=document.getElementById(arrDivs[j]);
        chosenDiv.style.display='block';
    }
}

function DisplayDiv()
{
    $("#btnSubmit").click(function() { 
        var arrcolor = new Array();

        for(var j=0;j<10;j++)
        {
            if($("'#'+arrDivs[j] input:radio:checked").val()==document.getElementById("true"))
                arrcolor[j]=1;
            else
                arrcolor[j]=0;
        }

        var arrnewDiv = new Array('31','32','33','34','35','36','37','38','39','40');
        for(var k=31;k<41;k++)
        {
            if(arrcolor[k-31]==0)
            {
                document.getElementById(arrnewDiv[k-31]).style.color="red";
                document.getElementById(arrnewDiv[k-31]).style.display='block';
            }
            else
            {
                document.getElementById(arrnewDiv[k-31]).style.color="green";
                document.getElementById(arrnewDiv[k-31]).style.display='block';
            }
        }
    });
}

Hope this helps.

AleMonteiro 238 Can I pick my title?

Hi,

you need to discover the difference in milliseconds and then convert to the unit you want.

Something like this:

// Constants
var minutes = 1000 * 60;
var hours   = minutes * 60;
var days    = hours * 24;
var years   = days * 365;

// Dates
var Date1= new Date("23-03-2012 04:25PM");
var Date2= new Date("26-09-2013 08:26AM");

// Datediff in milliseconds
var dif = Date2.getTime() - Date1.getTime();

// Convert to years
var difYears = Math.round(dif/years);
// Convert to days (subtracting the years)
var difDays = Math.round(dif/days) - (difYears * 365);

alert("Date diff: " + difYears + "year(s) and " + difDays + " day(s)" );

Hope it helps.

AleMonteiro 238 Can I pick my title?

Hi nvap, please post an example with what you are trying to do.

AleMonteiro 238 Can I pick my title?

fheppell,

those links might help you:

- JS Navigator Object
- Browser detect script

Hope it helps.

AleMonteiro 238 Can I pick my title?

Try this:

for (var n = 1; n < 4; n++) 
		{
			var zing = "#img" + n;
					
			$(zing)
				.fadeToggle(300).delay(500)
				.fadeToggle(2000).delay(2000);
		}
AleMonteiro 238 Can I pick my title?

What kind of data are you returning from the php page? Post a example.

AleMonteiro 238 Can I pick my title?

I wasn't able to reproduce the problem, but see if this works:

$(document).ready(function(){	
	
	$("#navlist li").hover(		
		function() {  
			if ( $(this).hasClass("minimized") )
			{
				$(this).stop().animate({ height: "75", opacity: 1  }, 1000 );
				$(this).find('a').show('slide', 500);
			}
			else
			{
				$(this).stop().animate({ top: '15px' }, 200, 'swing'); 
			}
		}, 
		function() {  
			if ( $(this).hasClass("minimized") )
			{
				$(this).stop().animate({ height: "7", opacity: 0.4  }, 1000 ).addClass("minimized");
				$(this).find('a').hide();
			}
			else
			{
				$(this).stop().animate({ top: '0px' }, 200, 'swing');	
			}
		}					
	);
  
	$('#navlist li').click(function(){   

		$('#navcontainer').animate({opacity: 1,"marginTop": 0,duration: "slow",easing: "easein"}, 1000 );
		
		$('#navlist li').not(this).animate({ height: "7", opacity: 0.4  }, 1000 ).addClass("minimized");
		
		$(this).removeClass("minimized");
		
		$('#navlist li a').hide();
		$(this).find('a').stop().animate({ opacity: 1 });		
		$(this).find('a').show('slide',1000);
	});
	
});
AleMonteiro 238 Can I pick my title?

Something like this?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>

<script type='text/javascript' src='http://code.jquery.com/jquery-1.4.4.min.js'></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.5/jquery-ui.js"> </script>
<script type='text/javascript'>
$(document).ready(function(){	
	
	$("#navlist li").hover(		
		function() {  
			if ( $(this).hasClass("minimized") )
			{
				$(this).animate({ height: "75", opacity: 1  }, 1000 ).addClass("minimized");
				$(this).find('a').show('slide', 500);
			}
			else
			{
				$(this).stop().animate({ top: '15px' }, 200, 'swing'); 
			}
		}, 
		function() {  
			if ( $(this).hasClass("minimized") )
			{
				$(this).animate({ height: "7", opacity: 0.4  }, 1000 ).addClass("minimized");
				$(this).find('a').hide();
			}
			else
			{
				$(this).stop().animate({ top: '0px' }, 200, 'swing');	
			}
		}					
	);
  
	$('#navlist li').click(function(){   

		$('#navcontainer').animate({opacity: 1,"marginTop": 0,duration: "slow",easing: "easein"}, 1000 );
		
		$('#navlist li').not(this).animate({ height: "7", opacity: 0.4  }, 1000 ).addClass("minimized");
		
		$(this).removeClass("minimized");
		
		$('#navlist li a').hide();
		$(this).find('a').stop().animate({ opacity: 1 });		
		$(this).find('a').show('slide',1000);
	});
	
});
</script>

<style>

/* CSS Document */

#navcontainer{
		text-align: center;
		text-transform: uppercase;				
		float: left;
		color: #333;
		background: #f0e7d7;
		height: 25px;
		width: 100%;
		display: inline-block;				
		padding: 2em 0;				
		margin-top:250px;
		padding-bottom:55px;
		padding-top:5px;
		position:relative;				
	     }
			  
		  
#navlist {
	   display: block;
	   list-style-type: none;
	   background:none;			
	   width: 70%;	
	   height: 100%;
	   padding: 0;
	   margin: 0 auto;				
	   position:relative;			
	 }


#navlist li{
	     display: inline;				
	     width:  125px;
	     height: 75px;				
	     float: left;		
	     position:relative;
	     padding-right:1px;
             background:#99CC66;
	    }
			
			
#navlist li a {
		display: block;
		width: 100%;
		height: 100%;
		background-repeat: no-repeat;
		background:none;
		color:#000000;
				
	      }
			  
#navlist li a span {
	             display: block;
	             padding: 60px 7px 0;
	             font-size: 12px;
	             text-align: center;
	             font-weight:bold;
                   }


</style>

	<div id="navcontainer">
	   <ul id="navlist">
		<li><a href="#" class="current"><span>Home</span></a></li>
		<li><a href="#"><span>About</span></a></li>
		<li><a href="#"><span>Contact</span></a></li>
		<li><a href="#"><span>Item four</span></a></li>
		<li><a href="#"><span>Item five</span></a></li>
	   </ul>
	</div>

</body>
</html>
AleMonteiro 238 Can I pick my title?

Ok, let's see:

1. All itens are showed at the center of the page.
2. Click on Home item.
3. The menu goes to the top of the page.
4. Home item remains the same size, and all others are minimized.

From there, what you want to do?

AleMonteiro 238 Can I pick my title?

You are welcome.

If you don't have any other doubts, please mark as solved, and if you think, as helpful.

AleMonteiro 238 Can I pick my title?

I really didn't understand what you are trying to do, but post you css so I can see the menu working and see if I figure it out.

AleMonteiro 238 Can I pick my title?

How are you loading the flashs? Post the code you are using, but keep it minimal to the problem.

AleMonteiro 238 Can I pick my title?

You just spit some code, but what's your problem? What are you trying to accomplish? What work and what does not?

AleMonteiro 238 Can I pick my title?

I don't think that is possible, at least I never come across something like that.

AleMonteiro 238 Can I pick my title?

I think that works, but you can improve that, if you want.

You could perhaps, in case of conflict when removing, alert the user and offers him the choices he would have, for example:
- Delete the row and conflicted row
- Keep change (must change conflicted row)
- Cancel change

Right and wrong depends too much on the flexibility you want your use to have.

AleMonteiro 238 Can I pick my title?

Your HTML structure don't let you do it. a#one is inside div.round, so every time you click a#one, you are mousing over div.round.

The best way is to modify your HTML with that in mind.

One way to do it, is this:

$(document).ready(function(){
    $("#expand").hide();
    $("#open").mouseover(
        function(){ $("#expand").slideDown(); }
    );
	$("#one").click(function(){
		$("#expand").slideUp("slow");
		 return false;
	  });
});
</script>
	<div class="round">
		<p><span id="open">Content here visible from start...</span><span class="ap-link"><a id="one" href="#expand">Show / hide full content </a></span></p>
		<div id="expand"><p> ...the rest of content is here.</p></div>
	</div>
</body>

But there is a lot of another ways too.

AleMonteiro 238 Can I pick my title?

Do you know JQuery? It's much more easier to work with AJAX, or manipulate DOM elements as you wish.

This is a simple test page using JQuery post mehtod, but there are many more with much more flexibility, if you need.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script>
    <script type="text/javascript">  

$(function() // OnLoad
{
	$.post( // Jquery post method
		"myurl.php" // url
		{
			parameter1: "myParameter",
			parameter2: "myParameter"
		},
		function(data) // On Success
		{
			$("#myDIV") // get myDiv object
				.html(data); // set its html content
		},
		function(error) // On Error
		{
			alert("AJAX Error: " + error);
		}
	);
});
		
		
    </script>        
</head>

<body>
    <div id="myDIV"></div>
</body>
</html>

Learn more at http://jquery.com/

If you can't use JQuery, say it and I'll go trough your code.

AleMonteiro 238 Can I pick my title?

This is something that should work:

$(function() // document ready
{
	$('<div/>') // create div 
		.html('<?= $chat_member_name; ?>') // set html content
		.attr({ // set attributes
			  id: 'chat_name_<?= $chat_user_id; ?>',
			  className: 'chat_name'
		})
		.appendTo('#chat_bar'); // append to chat box

	$('<div/>')
		.html('<?= $chat_text; ?>')
		.attr({
			  id: 'chat_text_<?= $chat_user_id; ?>',
			  className: 'chat_text'
		})
		.appendTo('#chat_box');
});

Your approach was more clean, but it has compatibility issues with IE(http://api.jquery.com/jQuery/)

AleMonteiro 238 Can I pick my title?

You have some options, two of them are:

Option 1. Before removing one row you need to check if it will cause any rout problem. If there is a problem, you don't remove the row.

Option 2. After you remove one row, you check if that lead to any rout problem. If so, you need to alert the error or set the location to 'Select Location' on the problematic row.

Hope it helps.

AleMonteiro 238 Can I pick my title?

You can use an iframe to open the directions page.

AleMonteiro 238 Can I pick my title?

Does it throws any errors?

AleMonteiro 238 Can I pick my title?

One more though about your code: All images(thumbs and big) are loaded when the page loads. Because all images are created on the HTML.

So, if the big images that are not seen, are loaded.

If you wish to just load the viewed images: instead of creating one image tag for each big image, you need to create only one image and change the src with JS.

Instead of passing the id of the image to the change_image() you could pass the image url and then set it on the big image display.

Just an observation.

AleMonteiro 238 Can I pick my title?

Violet, '$' doesn't mean anything to the browser, it's just part of the variable name.

I only name the vars with $ so I can tell it's a JQuery object. But if you want to name it objImage, it's the same thing.

The problem was not the $, but the misspell of the var name.

AleMonteiro 238 Can I pick my title?

Violet,

you are using the '$image' var but you are creating with the name 'image'.

var image = $("#" + image); // This should be var $image
$image.hide().fadeIn(1000);

Fix this and see the result.

AleMonteiro 238 Can I pick my title?

Violet, yes. It removes the handlers that the button has.

I did it because: every time the change_image() runs it adds a new click handler to the close_button, and when you click the button all handlers are executed.

Example: you open image one, close it and then open image two. When you close the image two it will actually try to close image one again(because the handler is still there).

If you open 10 images, when you close the last one, it would try and close all 10 again.

In your code this wasn't a problem, because the image one was already closed, so it won't do anything on the UI, but it still running and consuming memory.

This is a simple test page so you can see what really happens:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script>
    <script type="text/javascript">  
        $(function(){
            var $btn1 = $("#myButton_1");
			var $btn2 = $("#myButton_2");
			
			$btn1
				.click(function() { // Adds handler 1
					alert("Handler 1");
				})
				.click(function() { // Adds Handler 2
					alert("Handler 2");
				});
				
			$btn2
				.click(function() { // Adds handler 1
					alert("Handler 1");
				})
				.unbind('click') // Unbinds handler 1
				.click(function() { // Adds Handler 2
					alert("Handler 2");
				});
        });
    </script>        
</head>
<body>
    <button id="myButton_1" type="button">No Unbind</button>
	
	<button id="myButton_2" type="button">Unbinded</button>
</body>
</html>

You're welcome.

AleMonteiro 238 Can I pick my title?

Something like this?

$(function()
{
    $("#myDivID").children(":odd").animate(); // Animate odd
    $("#myDivID").children(":even").animate(); // Animate even
});
AleMonteiro 238 Can I pick my title?

Data is the new html you want to display?

If so, I guess you can do something like this:

$(".shopping_bag").html(data).fancybox({
		'width'				: '30%',
		'height'			: '30%'
	});
AleMonteiro 238 Can I pick my title?

Hi Violet, I think it's a good way to do it, and it's quite fast. I did something similar myself.

But you can always improve your code, I suggest something like this:

var $box, $overlay, $closeButton;

$(function()
{
	// Get re-used jquery objects only at page load
	// It would be even better if used ID(faster)
	$box = $(".box");
	$overlay = $(".overlay");
	$close_button = $(".close_button");
});

function change_image(image)
{
	var $image = $("#" + image);
	
	$overlay.hide().show();
	$box.hide().show("slow");
	$image.hide().fadeIn(1000);	
	$close_button.show();

	$close_button.unbind('click').click(function() {
		$(this).hide();
		$image.fadeOut("fast");
		$box.hide("slow");
		$overlay.hide("slow");
	});
}

Good work.

AleMonteiro 238 Can I pick my title?

If I did understand correctly, you want only the rows of the first table to have the expand/collapse functionality. Is that right?

If so, you need to tell JQuery only to get the direct children of the #report table.

To do that, you use the '>' operator. But there is a catch with tables, some browsers(I don't know if all of them) adds a <tbody> inside the table, so you need to do this:

$("#report > tbody > tr:odd")

But just to be sure it will work in all browsers, add manually the <tbody>, so if even the browser don't add it, it will always be there.

Here is the full code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>Expand table rows with jQuery - jExpand plugin - JankoAtWarpSpeed demos</title>
    <style type="text/css">
        body { font-family:Arial, Helvetica, Sans-Serif; font-size:0.8em;}
        #report { border-collapse:collapse;}
        #report h4 { margin:0px; padding:0px;}
        #report img { float:right;}
        #report ul { margin:10px 0 10px 40px; padding:0px;}
        #report th { background:#7CB8E2 url(header_bkg.png) repeat-x scroll center left; color:#fff; padding:7px 15px; text-align:left;}
        #report td { background:#C7DDEE none repeat-x scroll center left; color:#000; padding:7px 15px; }
        #report tr.odd td { background:#fff url(row_bkg.png) repeat-x scroll center left; cursor:pointer; }
        #report div.arrow { background:transparent url(arrows.png) no-repeat scroll 0px -16px; width:16px; height:16px; display:block;}
        #report div.up { background-position:0px 0px;}
    </style>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script>
    <script type="text/javascript">  
        $(document).ready(function(){
            $("#report > tbody > tr:odd").addClass("odd");
            $("#report > tbody > tr:not(.odd)").hide();
            $("#report > tbody > …
AleMonteiro 238 Can I pick my title?

Hi,

for what I can see, you don't have the id value, you just have the string '$id'.

This is all of your code?

AleMonteiro 238 Can I pick my title?

Hi, you are setting 'width', 'height' and others attributes to the ajax options, but they doesn't exists. The ajax method has nothing to do with the layout, it just makes an assync call.

AleMonteiro 238 Can I pick my title?

The function htmlspecialchars() returns a string and you are testing it against a integer, that might be the problem.

AleMonteiro 238 Can I pick my title?

What do you mean by split?

AleMonteiro 238 Can I pick my title?

Hi knitex, your code has a number of issues, so I thought about what you were trying to do and made it happen.

I hope this is what you need:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
<style type="text/css">
#theform {
	font-family: "Courier New", Courier, monospace;
	font-size: 12px;
}
</style>
<script type = "text/javascript">

function addText( evt ){
	
	var radioButtons = document.getElementsByName('choice')
	var choice = ""
	for( var x = 0; x < radioButtons.length; x++){
		if(radioButtons[x].checked){
			choice = radioButtons[x].value
			break;
		}
	}
	
	var form = evt.target.form; // Form
	var div = document.getElementById("change"); // Div that will hold the paragraphs
	var textNum = div.getElementsByTagName('p'); // Get only P inside 'change'
	var text = form.text.value; // Text of text area
	var position = form.position.value; // Position
	
	if(choice == "add"){
		var p = "<p>" + text + "</p>";
		div.innerHTML = div.innerHTML + p;
	}
	else if(choice == "delete"){
		var node = textNum[position]; // Get P from position
		node.parentNode.removeChild(node); // Remove P
	}
	else if(choice == "insert"){
		var p=document.createElement("p"); // Create P
		p.innerHTML = text;
		
		if ( textNum.length > 0 && position + 1 < textNum.length ) // If P is between others
		{
			div.insertBefore(p, textNum[position+1]);
		}
		else // If P is first or last
		{
			div.appendChild(p);
		}
	}
	else if(choice == "replace"){
		var node = textNum[position];
		node.innerHTML = text; // Change text of existing P
	}
	
	refreshList();
}

// Refresh dropdown list with all existing P's …
AleMonteiro 238 Can I pick my title?

When the click occurs you have to set the cookie, and then on the page load function you have to check the cookie and apply the class again.

AleMonteiro 238 Can I pick my title?

Pravinrasal,

if you want the length, you need to use an array.

//Create array
var graphArray =new Array();
// Add item to array
graphArray.push({ "concentration" : concentration,"answers" : ans });
// Alert array length
alert(graphArray.length);

But your code has some problems, for example: the options has no value, so the changeConcentration() function is not working.

AleMonteiro 238 Can I pick my title?

I'm glad to know it.

Just mark as solved then.

Seeya.

AleMonteiro 238 Can I pick my title?

Something like this, if you are closing from the parent window.

var childWindow = window.open(....);
childWindow.close();

if you want to close from the child window, you can do this:

self.close();

Hope it helps.

AleMonteiro 238 Can I pick my title?

I think it's quite fast, good work.

But the sub-menus aren't being displayed right.

AleMonteiro 238 Can I pick my title?

This should work fine:

<asp:Label ID="Label1" runat="server" Text="<%= Session["value"].ToString() %>" />

Doesn't it?