Jump to content


Photo

Table messed up?


  • Please log in to reply
2 replies to this topic

#1 MySQL_Narb

MySQL_Narb

    Advanced Member

  • Members
  • PipPipPip
  • 250 posts

Posted 17 February 2013 - 10:03 PM


<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Pfft</title>
<style>
body {
background-color:black;
}

.post {
padding:25px;
margin-left:auto;
margin-right:auto;
background-color:#980000;
border:1px solid #580000;
width:650px;
}

.message {
margin-left:auto;
margin-right:auto;
background-color:#980000;
border:1px solid #580000;
width:650px;
}

.hidden {
display:none;
}
</style>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
var step1 = $('#step1');
var step2 = $('#step2');

$('input[name="type"]').change(function(){
hideAll();
step2.show('fast');

if($('input[name="type"]:checked').val() == 'posts'){
$('tr[id="is_posts"]').show();
}
});

$('button[name="reset"]').click(function(){
hideAll();
step1.show();
$('input[name="thread"]').val('');
$('input[name="forum"]').val('');
$('textarea[name="content"]').val('');
});


function hideAll(){
step1.hide('fast');
step2.hide('fast');
}
});
</script>
</head>
<body>

<div class="post">
<form action="index.php" method="POST">
<div id="step1">
<input type="radio" name="type" value="threads">Threads or <input type="radio" name="type" value="posts"> Posts
</div>
<div id="step2" class="hidden">
<table>
<tr>
<td>Forum ID<td/>
<td><input type="text" name="forum"></td>
</tr>
<tr id="is_posts" class="hidden">
<td>Thread ID</td>
<td><input type="text" name="thread"></td>
</tr>
<tr>
<td><button name="step3">Continue</button></td>
<td><button name="reset">Reset</button></td>
</tr>
</table>
</div>
</form>
</div>

<?php
if(isset($_POST['message']) && ctype_digit($_POST['amount'])){

?>

<div class="message">
Your messages are being sent.
</div>

<?php
}
?>
</body>
</html>

Whenever the tr with the id #is_posts isn't hidden, the first tr in the table becomes deformed.

Here's a picture:

http://puu.sh/24laL

#2 Jessica

Jessica

    This is not my name.

  • Gurus
  • 8,982 posts
  • LocationDallas, TX
  • Age:26

Posted 17 February 2013 - 11:19 PM

<td>Forum ID<td/>

Notice anything??
My goal in replying to posts is to help you become a better programmer, including learning how to debug your own code and research problems. For that reason, rather than posting the solution, I reply with tips and hints on how to find the solution yourself. See below for useful links when you get stuck.

How to Get Good Help: How to Ask Questions | Don't be a help vampire
Debugging Your Code: Debugging your SQL | What does a php function do? | What does a term mean? | Don't see any errors?
Things You Should Do: Normalize Your Data | use print_r() or var_dump()
Lulz: "Functions should not have side effects." - trq

Please take a look at my new PHP/Web Dev blog: The Web Mason - Thanks!!

#3 MySQL_Narb

MySQL_Narb

    Advanced Member

  • Members
  • PipPipPip
  • 250 posts

Posted 20 February 2013 - 06:24 PM

<td>Forum ID<td/>

Notice anything??


Hah, wow. I always know it's something so simple, but no matter how long I look through the code I miss these things.

Thanks.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com