Hi,

Firstly, thanks for your help about headers/footers earlier, that was a great help - 
but I found out about EmbperlObject and now I'm using that, which is very nice indeed. 
 Embperl is really growing on me and I thank you for all the work you must have put in.

I have a new question - what is the Embperl way of doing:

@xyz = ('one', 'two', 'three');
$default = 'The default option';

                    <select name="sel" size="1">
                      <option value="default">[+ $default +]</option>
                      <option value="[+ $xyz[$row] +]">[+ $xyz[$row] +]</option>
                    </select>

i.e. to have a default?  The use of $row here causes my default to be replicated many 
times, and I get:

default
one
default
two
default
three

I don't want to prepend the default to my array because I want a different string to 
the value.  I could do:

                    <select name="sel" size="1">
                      <option value="[+ $xyz[$row] +]">[+ $xyz[$row] eq 'default' ? 
'The default option' : $xyz[$row] +]</option>
                    </select>

But after you have a few extra cases like this it becomes messy, for example if I have 
several default and serveral data sources I am putting into this select.

It seems to me it would be nice if an <option> with a $row in it does not duplicate 
all of the contents of the <select> but only the contents of the enclosing <option>?


Best wishes, James
--
James Ponder



--

This e-mail may contain confidential and/or privileged information. If you are not the 
intended recipient (or have received this e-mail in error) please notify the sender 
immediately and destroy this e-mail. Any unauthorized copying, disclosure or 
distribution of the material in this e-mail is strictly forbidden.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to