What is the best way to implement this?
The user should be able to add multiple attributes to a product, like this:
Attribute 1 ---
Category: <select> box
Description: <input type="text">
And then you should be able to click a plus (+) button, and a new select box and text field should show to add attribute 2 and so on.
I'm thinking of solving this by doing something like this, but I'm not sure if that's the best way? Feels a little "ugly" for jQuery
-
var index = 0;
function plusButton()
{
$('#wrap').append("<p><select name='box[" + index + "]'><option>foo</option></select><input type='text[" + index + "]'></p>");
index++;
}