Jump to content

Can't get checkbox value


neven

Recommended Posts

:confused:Hi I have a problem with check box in jquery directory tree... I can't get value from it !!! :S

The value of $file show's as "array" in the echo"$files";  not as the real value of the file that is show'n in the directory tree.

Can someone help mee with this ?

 

 

<input type='checkbox' name='del[]' id='del' value='$file'/><a href=\"".$path.$file."\"><img src='slike_izgled/file.png'> $file</a>

 

if(isset($_POST['filedel'])) {                      

$id = $_POST[del];

$count = count($id);

for ($i=0; $i<$count; $i++){

$files = $_POST['del'];

 

echo"$files.$count";

              }

 

Directory_tree.JPG

 

 

 

 

   

Link to comment
Share on other sites

where is the "$_POST['filedel']" field in the above example.. if a input checkbox, radio, text, or otherwise doesnt have the name/id of "filedel" then it is never set, and will just run past the if statement.

 

I think $_POST['filedel'] is the submit button, maybe? Could be wrong here tho...

 

James

Link to comment
Share on other sites

Ok this is what i get back "Array.2

 

Array

(

    [0] => Dundo Maroje.txt

    [1] => popis.txt

)

 

Array.2

 

Array

(

    [0] => Dundo Maroje.txt

    [1] => popis.txt

)

" That is what I'm loking to get .... Now this is what I need ....This files up from that are the files from directory tree that i have check'ed in check box now I vant to delet them How to do that?

Link to comment
Share on other sites

where is the "$_POST['filedel']" field in the above example.. if a input checkbox, radio, text, or otherwise doesnt have the name/id of "filedel" then it is never set, and will just run past the if statement.

 

I think $_POST['filedel'] is the submit button, maybe? Could be wrong here tho...

 

James

 

 

 

JES THAT IS THE SUBMIT BUTTON !!!

Link to comment
Share on other sites

Slightly hard to read because there is no "[ PHP][/ PHP]" or "[ CODE][/ CODE]" tags surrounding the results but;

 

Array
(  
[0] => Dundo Maroje.txt
[1] => popis.txt
)

Array
(
[0]=> Dundo Maroje.txt
[1] => popis.txt
)

 

So if you were to put this in your logic it should put you on the right tracks.

 

echo $file[0] . ' - ' . $file[1] . '<br />';
echo $files[0] . ' - ' . $files[1] . '<br />';

 

James.

Link to comment
Share on other sites

Slightly hard to read because there is no "[ PHP][/ PHP]" or "[ CODE][/ CODE]" tags surrounding the results but;

 

Array
(  
[0] => Dundo Maroje.txt
[1] => popis.txt
)

Array
(
[0]=> Dundo Maroje.txt
[1] => popis.txt
)

 

So if you were to put this in your logic it should put you on the right tracks.

 

echo $file[0] . ' - ' . $file[1] . '<br />';
echo $files[0] . ' - ' . $files[1] . '<br />';

 

James.

 

 

Thanks man ! :) Now ther is the one more thing that I'm asking ... Can you tell me how to inplement that result in the script that whil delete that file from the directory ? I remind you that this file is in the jquery directory tree . Can you help mee?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.