[EP-tech] Re: Simple(?) eprints make_element question
David McElroy
D.Mcelroy at uel.ac.uk
Wed Apr 16 14:10:22 BST 2014
That seems to result in:
<select name="select_name">
<option value="value1" selected="selected">value1</option>
<option value="value2">value2</option>
</select>
Which doesn’t make it selected unfortunately.
Thanks,
David
From: eprints-tech-bounces at ecs.soton.ac.uk [mailto:eprints-tech-bounces at ecs.soton.ac.uk] On Behalf Of John Salter
Sent: 16 April 2014 13:58
To: 'eprints-tech at ecs.soton.ac.uk'
Subject: [EP-tech] Re: Simple(?) eprints make_element question
I think you need to do:
my $option = $session->make_element( 'option', value=>"value1" selected=>"selected");
Cheers,
John
From: eprints-tech-bounces at ecs.soton.ac.uk [mailto:eprints-tech-bounces at ecs.soton.ac.uk] On Behalf Of David McElroy
Sent: 16 April 2014 13:49
To: 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”);
and
my $option = $session->make_element( 'option', value=>"value1");
to get:
<select name="select_name">
<option value="value1">value1</option>
<option value="value2">value2</option>
</select>
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>
</select>
Any ideas?
Thanks,
David McElroy
Research Data Management Officer
University of East London
Docklands Library
University Way
London E16 2RD
telephone: 020 8223 6467
twitter: davidlmcelroy
This message has been scanned by the UEL anti-spam filters hosted by Websense<http://www.websense.com/content/MessagingSecurity.aspx>
Report this email as spam.<https://www.mailcontrol.com/sr/T5QWCM3IvZDGX2PQPOmvUpjAP6sbmVCmj8IzE210rcmAOhoeXHzlkl2bjbyrfRJyZ7Lf5HjJPnjgE3KctAewCA==>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20140416/51c7eadf/attachment-0001.html
More information about the Eprints-tech
mailing list