Email conversation
From | Deepa Kuruvilla |
To | Me |
Subject | Problem with form element array |
Date | 22 November 2005 06:43 |
Sir,
Would u please help me to solve my problem?
I am a php programmer.I have set of check boxes with same name and differnt
ids. i used for loop and assigned different names as follows
<input type="Checkbox" id="delete_<?=$row+1?>" name="delete[]"
value="<?=$country_id?>">
I dont want some of them satisfying certain condition and i put in use
instead of the chek box.
I used another check box to select all the check boxes i created in this
way.
Now I want to select all the check boxes if they exist. How i can do it?
Thanks in advance.
From | Me |
To | Deepa Kuruvilla |
Subject | Re: Problem with form element array |
Date | 22 November 2005 10:19 |
Deepa,
> <input type="Checkbox" id="delete_<?=$row+1?>" name="delete[]"
> value="<?=$country_id?>">
>
> Now I want to select all the check boxes if they exist. How i can do it?
In JavaScript, the way to reference an element using its id is this:
document.getElementById('delete_3')
So you could use a for loop like this:
for( var i = 1, j; j = document.getElementById('delete_'+i); i++ ) {
j.checked = true;
}
Mark 'Tarquin' Wilton-Jones - author of http://www.howtocreate.co.uk/
From | Deepa Kuruvilla |
To | Me |
Subject | Re: Problem with form element array |
Date | 23 November 2005 08:54 |
Sir
Thanks for your reply.
It helped me a lot to reduce the code and increase efficiency.
From | Deepa Kuruvilla |
To | Me |
Subject | [blank subjects are not a good idea] |
Date | 3 January 2006 06:52 |
sir
1. how we can track the browser window close. I need to execute some code
when the user clicks on the "X"(close) button.
2. how to display a message when the user clicks on a link
From | Me |
To | Deepa Kuruvilla |
Subject | Re: |
Date | 3 January 2006 09:55 |
Deepa,
> 1. how we can track the browser window close. I need to execute some
> code when the user clicks on the "X"(close) button.
I have discussed this problem in detail here:
http://www.howtocreate.co.uk/emails/GregBurman.html
> 2. how to display a message when the user clicks on a link
<a href="" onclick="alert('foo')">
From | Deepa Kuruvilla |
To | Me |
Subject | |
Date | 4 January 2006 06:41 |
sir
how we can track the browser window close. I need to execute some
code when the user clicks on the "X"(close) button.
i am not using a frame set.so i want a diffent solution.can we deal this
using clientX or ClientY.
From | Me |
To | Deepa Kuruvilla |
Subject | Re: |
Date | 4 January 2006 09:58 |
Deepa,
> how we can track the browser window close. I need to execute some code
> when the user clicks on the "X"(close) button.
>
> i am not using a frame set.so i want a diffent solution.can we deal
> this using clientX or ClientY.
you cannot. and clientx/y is useless because it does not work cross browser.
you will either have to use a frameset, or abandon the idea.