Jump to content

Recommended Posts

anyone know why this wont work? (variables come from php)

$rk is the identifying key, and $r[id] is an identifying id, $cb is tells us if its hidden or not...

 

<a href="javascript:hidecell('.$rk.','.$r[id].');" style="font-size:20px;font-weight:700;">'.$cp.'</a>

<td colspan=2 style="display:'.$cb.';" id="'.$rk.'">test</td>

<script>
function hidecell(key,id){
var el=getObject(key);
if(el.style.display=='none'){
  setcookie("forumcategories["+id+"]","shown");
  this.innerHTML='-';
  el.style.display='block';
}else{
  setcookie("forumcategories["+id+"]","hidden");
  this.innerHTML='+';
  el.style.display='none';
}
}
</script>

Link to comment
https://forums.phpfreaks.com/topic/86566-solved-javascript-hider/
Share on other sites

Take out your php and just post static html (for demo purposes only). I see where you are referencing your "key" parameter, but I do not see where you are referencing your "id" parameter. Post a static html example of your code; so I can take a better look at it.

i think you've to put the php tag <?php ?> in the variable used i.e.  variable should be replaced by <?php $rk ?>, try this one out if you have not done that.

 

http://roshanbh.com.np

 

well that is definitely true; but I figured taith already knew that, so I didn't even mention that.

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.