| 1 | 1 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 2 | 1 | ▶ | use warnings FATAL => 'all'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 3 | |||||||||||||
| 4 | package HTML::Tested::JavaScript::AutoSelect; | ||||||||||||
| 5 | 1 | ▶ | use base 'HTML::Tested::Value::DropDown'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 6 | |||||||||||||
| 7 | 0 | ▶ | sub value_to_string { | ||||||||||
|
Subroutine
value_to_string: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||
| 8 | 0 | my ($self, $name, $val) = @_; | |||||||||||
| 9 | 0 | my $res = $self->SUPER::value_to_string($name, $val); | |||||||||||
| 10 | 0 | ▶ | my $href = $self->options->{href} || "?$name="; | ||||||||||
|
Condition0%0/2
$self->options->{'href'} || "?$name="
MC/DC0%0/1
$self->options->{'href'} || "?$name="
$self->options->{'href'}
Truth table0%0/2
A
A= $self->options->{'href'}
| |||||||||||||
| 11 | return <<ENDS | ||||||||||||
| 12 | <form>$res</form> | ||||||||||||
| 13 | <script> | ||||||||||||
| 14 | document.getElementById("$name").onchange = function() { | ||||||||||||
| 15 | document.location.href = "$href" + this.options[ | ||||||||||||
| 16 | this.selectedIndex ].value; | ||||||||||||
| 17 | }; | ||||||||||||
| 18 | </script> | ||||||||||||
| 19 | ENDS | ||||||||||||
| 20 | 0 | } | |||||||||||
| 21 | |||||||||||||
| 22 | 1 | 1; | |||||||||||