Closed Siggs2000 closed 9 years ago
@Siggs2000 Can you show the code you are using to create the field and retrieve the value?
@Siggs2000 We ran into this issue on the app we are working on as well. Related issue #47 for reference.
In redpotion you can find the form field and grab the text from it, but with more than a few form fields that can get messy.
The best solution we found was switching to PM-XLForm.
I think I'm going to make that switch but ran into a little issue there that I just worked out this morning. Thanks.
Same problem here, drives me crazy... Here is the code:
class NewEntryTableScreen < PM::FormScreen
title "Title"
# stylesheet NewEntryTableScreenStylesheet
def on_load
set_nav_bar_button :right, title: "Save", action: :nav_right_button
end
def form_data
[{
title: "Date and time",
cells: [{
name: "time",
title: "When?",
type: :datetime,
}, {
name: "duration",
title: "How long?",
type: :text,
placeholder: "Time in minutes"
}, {
name: "rating",
title: "Rating?",
type: :text,
options: ["1", "2", "3", "4", "5"]
}, {
name: "description",
title: "Description",
type: :longtext
}]
}]
end
def nav_right_button
mp render_form
end
end
This is what gets rendered and I entered:
Terminal output:
(main)> {
:time => 2015-11-14 20:03:24 +0100,
:duration => -1441151880758558631,
:rating => "5",
:description => "my description"
}
mp data[:duration].class
=> Fixnum
+1
Hey guys,
I'm not going to be supporting ProMotion-form any longer. We now use ProMotion-XLForm instead. If you want to submit a patch for this, I'd be happy to merge it and release a new version, but won't have time to debug it myself.
Thanks!
I switched to ProMotion-XLForm too and it was a really easy transition and it works great
Yeah I'll switch as well then, I just wasn't sure which gem to go with.
ProMotion-form has been officially deprecated. Thanks everyone!
Occasionally when I render the data from a form the text value entered is somehow changed to a huge negative number like: -1441151880758529039
It seems to happen most when the text value is very short. It also happens on password type forms.
I'm using gem version 0.3.1 and PM version 2.4.2 in redpotion 1.4.0