From a06ee99642063236a86fe591209ca3d6afb838cb Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Tue, 14 Sep 2010 13:31:18 -0700 Subject: [PATCH] Convert Float to headTags --- lib/WebGUI/Form/Float.pm | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/WebGUI/Form/Float.pm b/lib/WebGUI/Form/Float.pm index 5ef82df8b..c2f201e16 100644 --- a/lib/WebGUI/Form/Float.pm +++ b/lib/WebGUI/Form/Float.pm @@ -126,6 +126,19 @@ sub getValue { #------------------------------------------------------------------- +=head2 headTags ( ) + +Set the head tags for this form plugin + +=cut + +sub headTags { + my $self = shift; + $self->session->style->setScript($self->session->url->extras('inputCheck.js'),{ type=>'text/javascript' }); +} + +#------------------------------------------------------------------- + =head2 isDynamicCompatible ( ) A class method that returns a boolean indicating whether this control is compatible with the DynamicField control. @@ -146,7 +159,6 @@ Renders a floating point field. sub toHtml { my $self = shift; - $self->session->style->setScript($self->session->url->extras('inputCheck.js')); $self->set("extras", $self->get('extras') . ' onkeyup="doInputCheck(document.getElementById(\''.$self->get("id").'\'),\'0123456789-.\')"'); return $self->SUPER::toHtml; }