Log in

View Full Version : DIV tags moves to right when select all button selected



shyne
06-27-2007, 10:14 PM
Hi

Ihave no idea why this is happening. I have a check box beside each song and a button that if clicked on select all the songs checkboxes and if click again it de-selects the checkboxes. Everything works fine except when click on select all button it moves the whole div on right side to the left. I have two columns left and right, left one has a width of 188px and is a menu, whereas right column is the main content. Now the right column shifts to the end of left column height and when you de select the button it comes back to its place. I don;t know what needs to be changed to make sure it doesnt shift places when click on select/deslect all button.



/*code for select all de select all*/
var checkflag = "false";
function check(field) {
if (checkflag == "false") {
for (i = 0; i < field.length; i++) {
field[i].checked = true;}
checkflag = "true";
return "UnSelect All"; }
else {
for (i = 0; i < field.length; i++) {
field[i].checked = false; }
checkflag = "false";
return "Select All"; }
}


Thanks for any help

Jas
06-28-2007, 09:52 PM
Something similar happened to me when I had two div's with the same ID. And after looking at your source code, it seems that you have a similar problem. The div is being edited by your function. Easy to fix. Try giving the div a new id.

shyne
06-28-2007, 10:10 PM
Hi

Thanks for the reply. So do you mean I should change the name for the right column to something different? I ll try that and let you kno but by the way I am using class and not id does that still effect?

Jas
06-28-2007, 10:18 PM
I ll try that and let you kno but by the way I am using class and not id does that still effect?

Yeah, it may not have any effect (still worth trying though). If you have firefox and firebug, you can use those tools to check for errors as well (I would if I had them where I am now; I feel weird not having PHP designer and Firefox). There are a bunch of things to check for. I would give everything a border and poke around the page for a while if the ID doesn't help.

shyne
06-28-2007, 10:37 PM
It didn't work. I tried changin the name to rightcloumn570 and instead of class I used ID and still same shifts happening. Can you may be tell me a change to script function for select/de select all. Since when I remove that its fine so I am guessing it hasto do with the fucntion messing with the column somehow.

shyne
06-28-2007, 10:54 PM
I changed the function it works now. Thanks alot