Class: ODDB::Html::View::PayPal::RegisterForm

Inherits:
HtmlGrid::Form
  • Object
show all
Includes:
HtmlGrid::ErrorMessage
Defined in:
lib/oddb/html/view/paypal/register_form.rb

Constant Summary collapse

COMPONENTS =
{
  [0,0]  =>  :email,
  [0,1]  =>  :pass,
  [3,1]  =>  :confirm_pass,
  [0,2]  =>  :salutation,
  [0,3]  =>  :name_last,
  [0,4]  =>  :name_first,
  [1,5]  =>  :submit,
}
CSS_CLASS =
'invoice'
EVENT =
:checkout
LABELS =
true
LEGACY_INTERFACE =
false
SYMBOL_MAP =
{
  :salutation   =>  HtmlGrid::Select,
  :pass         =>  HtmlGrid::Pass,
  :confirm_pass =>  HtmlGrid::Pass,
}

Instance Method Summary collapse

Instance Method Details

#email(model, session = @session) ⇒ Object



92
93
94
95
96
97
98
99
100
101
# File 'lib/oddb/html/view/paypal/register_form.rb', line 92

def email(model, session=@session)
  input = HtmlGrid::InputText.new(:email, model, @session, self)
  url = @lookandfeel._event_url(:ajax_autofill, {:email => nil})
  if(@session.logged_in?)
    input.set_attribute('disabled', true)
  else
    input.set_attribute('onChange', "autofill(this.form, 'email', '#{url}');")
  end
  input
end

#initObject



87
88
89
90
91
# File 'lib/oddb/html/view/paypal/register_form.rb', line 87

def init
  @model = @session.user
  super
  error_message
end