How to append category name to category ID in a form field

What would I need to do so that every row has a unique input box, which the user inputs a numeric value, and then the category name is appended to it.

e.g

Read More
Category | Time
-----------------
Home     |   7

So that the 7 would be entered into the input box, but when the value is saved, it is appened with the category name. Bear in mind there would be multiple categories. This is what I have so far

$categories = get_categories($args);
          foreach($categories as $category) { 
            echo "<tr>";
            echo '<td><a href="' . get_category_link( $category->term_id ) . '" title="' . sprintf( __( "View all posts in %s" ), $category->name ) . '" ' . '>' . $category->name.'</a></td>';
            echo "<td><input/></td>";
            echo "</tr>";
            } 

Related posts

Leave a Reply

1 comment

  1. I’m not quite sure how you’ll be using these but wouldn’t it make sense to concatenate the category ID with the name to make it unique?

    <input type="text" name="<?php echo $category->term_id."-".$category->name; ?>" />