Last time I was stuck for ideas, I posted a message here and got some fantastic replies - so I'm here again!
I have a requirement to build an XML file. The file is a configuration file and in itself is quite simple. It looks like this
<Field name="Some Field">
<Encoding>LTE</Encoding>
<ConfigByteCode>1</ConfigByteCode>
<LengthFieldSize>2</LengthFieldSize>
<StringValue nullTerminated="true" size="variable">Test</StringValue>
</Field>
In the configuration file, there could be one of these - or 5 or 50. The average end user who would be using my program would have a text description for "ConfigByteCode" and a value to assign to in (StringValue).
Building the XML file is easy - The different types of ConfigByteCode and the other values would be stored in a MySQL database so that bit is easy. My idea is to have a pop-up menu populated with
<option value='$cbc'>$cbc_text</option>
where $cbc is the configByteCode and $cbc_text is the text description of what that CBC is for, and a text field. The user picks an item from the menu and enters a value in the text field.
This is the bit I need help with - the user then clicks a + button and another pop up menu and text field appear below the current one. They choose and item, fill in the text field, click the + sign and another pop up and text field appear. And so on, until they've added everything they need to add.
Is that acheivable? I can do it by adding 50 pop up and text field pairs in DIVs and showing them with JavaScript but I'm wondering if there's a more efficient way that I haven't discovered yet.
Thanks for any advice
Steve