Jump to content

bytesize

Members
  • Posts

    56
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

bytesize's Achievements

Member

Member (2/5)

0

Reputation

  1. If jquery 1.3 is used with this code a single click works, which is what I want, but if jquery 1.4 or higher is used a double click is required. Can anyone tell me what is causing the double click? <head> <style type="text/css"> .interactionLinksDiv a { font-size: 12px; font-family: Geneva, sans-serif; font-weight: normal; } .interactionLinksDiv a:hover { font-size:12px; text-decoration: underline; } .interactContainers { display:none; margin-top: 4px; } </style> <script type="text/javascript"> function toggleInteractContainers(x) { if ($('#'+x).is(":hidden")) { $('#'+x).slideDown(200); } else { $('#'+x).hide(); } $('.interactContainers').hide(); } </script> </head> <body> <?php $interactionBox = '<div class="interactionLinksDiv"> <a href="#" onclick="return false" onmousedown="toggleInteractContainers(\'add_friend\');">Add <b>Joey</b> to Friends</a> </div>'; echo $interactionBox; ?> <div class="interactContainers" id="add_friend"> Friend <b>Joey</b>? <a href="#" onclick="return false" onmousedown="toggleInteractContainers('add_friend');" title="Close">Later</a> </div> </body> </html>
  2. I can't figure out how to make - textarea[name=send[mc_comment]] - work. When I add text to send[mc_comment] it only works on the first post comment and the other post comments are empty! Can anyone help me with this? a, b, c, d, e work as they should. $curpost = postid in the database. <script type="text/javascript"> var commentUrl = "views/layouts/comments.php"; function mainComment(a,b,c,d,e,f) { var f = $("textarea[name=send[mc_comment]]").val(); var page = (d); $("#"+page).text("Please wait...").show(); $.post(commentUrl,{user:a, friend:b, postid:c, where:d, which:e, send:f},function(data){$("#"+page).html(data).show().fadeOut(1000)}) } </script> <form action="" method='POST'> <textarea name='send[mc_comment]'></textarea> <a href='#' onclick="return false" onmousedown="javascript:mainComment('<?php echo $usercode; ?>', '<?php echo $othermember; ?>', '<?php echo $curpost; ?>', '<?php echo 'add'.$curpost; ?>', '<?php echo $comment; ?>');">Yes</a> </form>
  3. Jessica, thank you for your help, you pointed me in the right direction. It took a little bit of work on the php side, but I got it to work!
  4. Yes, the page is being redirected in the controller. Thanks for your help. I will continue working on this until I figure it out.
  5. <script type="text/javascript"> function toggleInteractContainers(x) { if ($('#'+x).is(":hidden")) { $('#'+x).slideDown(200); } else { $('#'+x).hide(); } $('.interactContainers').hide(); } </script> <?php $interactionBox = '<div class="interactionLinksDiv"> <a href="#" onclick="return false" onmousedown="javascript:toggleInteractContainers(\''.$show['wb_memberid'].'\');">Send Request</a> </div>'; echo $interactionBox; ?> <div class="interactContainers" id="<?php echo $show['wb_memberid']; ?>"> <a href="users/add?add=<?php echo $show['code']; ?>">Yes</a> <a href="#" onclick="return false" onmousedown="javascript:toggleInteractContainers('<?php echo $show['wb_memberid']; ?>');" title="Close">No</a> </div> When scrolled down to the "Yes" link and it is clicked, the page jumps up to the top of the browser. If "No" is clicked, the page does not move, which is the effect I'm looking for. How can I stop the page from jumping to the top? I have tried using "#", onclick, and onmousedown within the "Yes" href to no avail. Anyone?
  6. $user = current_user('code'); $query = sprintf("SELECT * FROM responds JOIN questions ON questions.q_id=responds.question_id JOIN users ON questions.q_questionby=users.code WHERE responds.re_respondby='%s' AND questions.q_questionby=users.code ORDER BY questions.question", mysql_real_escape_string($user)); $result = mysql_query($query); $exists = mysql_num_rows($result); while($row = mysql_fetch_array($result)) { if($user!=$row['code']) { echo $row["question"]; } } Thank you for responding to my question. This is the display output. The numbers represent the question id. 6 Proin id lorem nunc, eget scelerisque lectus. Nulla quis nisi accumsan leo rhoncus elementum.… 6 Proin id lorem nunc, eget scelerisque lectus. Nulla quis nisi accumsan leo rhoncus elementum.… 16 Eget diam mi. Nam sed lectus vel metus elementum varius. Curabitur tincidunt faucibus neque… 3 Diam libero iaculis a gravida ac elementum ac dolor. In hac habitasse platea dictumst. Nulla tem… 3 Diam libero iaculis a gravida ac elementum ac dolor. In hac habitasse platea dictumst. Nulla tem… 20 Cras aliquam odio a metus varius eget dictum ipsum accumsan. Maecenas justo dui, aliquam… 20 Cras aliquam odio a metus varius eget dictum ipsum accumsan. Maecenas justo dui, aliquam… As you can see, the question is being display more than once for questions with more than one answer. The $user variable is showing all my answers in responds.re_respondby='%s' How can I show only one question?
  7. <?php $user = current_user('code'); $query = sprintf("SELECT * FROM responds JOIN questions ON questions.q_id=responds.question_id JOIN users ON questions.q_questionby=users.code WHERE responds.re_respondby='%s' AND questions.q_questionby=users.code ORDER BY responds.re_id", mysql_real_escape_string($user)); $result = mysql_query($query); $exists = mysql_num_rows($result); ?> If I have more than one answer per question, the same question will display multiple times depending on how many answers there are for that question. Example question: How can I do this if I'm doing that? Let's say there are 10 answers to that question. 3 of those answers are mine. That question will display 3 times instead of once. Can this be done in the query?
×
×
  • 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.