[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[EP-tech] Re: Simple(?) eprints make_element question

Ha ? beaten by John again!

From: Alan.Stiles
Sent: 16 April 2014 14:02
To: 'eprints-tech at ecs.soton.ac.uk'
Subject: RE: Simple(?) eprints make_element question

Hi David,
Try something like

$option = $session->make_element( "option", value=>?value1?, selected=>"selected" );

But obviously only for the value you specifically want.


From: David McElroy [mailto:D.Mcelroy at uel.ac.uk]
Sent: 16 April 2014 13:49
To: eprints-tech at ecs.soton.ac.uk<mailto:eprints-tech at ecs.soton.ac.uk>
Subject: [EP-tech] Simple(?) eprints make_element question

Hi List,
                I?m doing some work on a theme for our new repository, and I?m adding a <select> drop down form. I?m using:

my $select = $session->make_element( 'select', name=>"select_name?);


my $option = $session->make_element( 'option', value=>"value1");

to get:

<select name="select_name">
<option value="value1">value1</option>
<option value="value2">value2</option>

And I?d like to be able to add a ?selected? to one of the options.  So it renders like this:

<select name="select_name">
<option value="value1" selected>value1</option>
<option value="value2">value2</option>

Any ideas?


David McElroy
Research Data Management Officer

University of East London
Docklands Library
University Way
London E16 2RD

telephone: 020 8223 6467
twitter: davidlmcelroy

-- The Open University is incorporated by Royal Charter (RC 000391), an exempt charity in England & Wales and a charity registered in Scotland (SC 038302).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20140416/1a0e5685/attachment.html