get value of an input field (was Re: [amber-lang] Lack of Documentation)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

get value of an input field (was Re: [amber-lang] Lack of Documentation)

Hannes Hirzel
On 12/21/14, [hidden email] <[hidden email]> wrote:
> Le 21 déc. 2014 04:48, "Richard Eng" <[hidden email]> a écrit :
>>
>> I'm still having trouble grokking Amber. The severe lack of documentation
> is really holding me back. I'm just trying to get a handle on the basics of
> working with HTML elements such as forms and input fields. For example, how
> do I obtain the value that a user types into an input field? How do I go
> about processing a form?

For example

      (document getElementById: 'theIdOfMyInputField') value


>> We need more Amber examples that cover the basics of HTML and DOM
> elements.
>
> For most of the forms related things, I'd use jQuery facilities to access
> fields.
>
> #field1 asJQuery ...

      #field1 asJQuery value

gives an error message


Richard, your contribution is an important question. May I ask you to
open an issue at
https://github.com/amber-smalltalk/amber-documentation/issues

>
> So, as Amber gives direct access to the jQuery API, one can read form
> values as one would in jQuery.
>
> I am away from the dev box but this should help you getting started.
>
> FWIW I've started documentation works and there is a piece foreseen about
> that.
>
> HTH
> Phik
>
>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
> "amber-lang" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
> email to [hidden email].
>> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups
> "amber-lang" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [hidden email].
> For more options, visit https://groups.google.com/d/optout.
>

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: get value of an input field (was Re: [amber-lang] Lack of Documentation)

horrido
Surprisingly, this works:

'#field1' asJQuery val.

The reason is because the JavaScript function is val().


On Sunday, 21 December 2014 10:21:51 UTC-5, Hannes wrote:
On 12/21/14, <a href="javascript:" target="_blank" gdf-obfuscated-mailto="hHhfxGIW9KwJ" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">ph...@... <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="hHhfxGIW9KwJ" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">ph...@...> wrote:
> Le 21 déc. 2014 04:48, "Richard Eng" <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="hHhfxGIW9KwJ" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">horrido...@...> a écrit :
>>
>> I'm still having trouble grokking Amber. The severe lack of documentation
> is really holding me back. I'm just trying to get a handle on the basics of
> working with HTML elements such as forms and input fields. For example, how
> do I obtain the value that a user types into an input field? How do I go
> about processing a form?

For example

      (document getElementById: 'theIdOfMyInputField') value


>> We need more Amber examples that cover the basics of HTML and DOM
> elements.
>
> For most of the forms related things, I'd use jQuery facilities to access
> fields.
>
> #field1 asJQuery ...

      #field1 asJQuery value

gives an error message


Richard, your contribution is an important question. May I ask you to
open an issue at
<a href="https://github.com/amber-smalltalk/amber-documentation/issues" target="_blank" onmousedown="this.href='https://www.google.com/url?q\75https%3A%2F%2Fgithub.com%2Famber-smalltalk%2Famber-documentation%2Fissues\46sa\75D\46sntz\0751\46usg\75AFQjCNG3U_qHCRefjWfIwV_JvcEsh23sjw';return true;" onclick="this.href='https://www.google.com/url?q\75https%3A%2F%2Fgithub.com%2Famber-smalltalk%2Famber-documentation%2Fissues\46sa\75D\46sntz\0751\46usg\75AFQjCNG3U_qHCRefjWfIwV_JvcEsh23sjw';return true;">https://github.com/amber-smalltalk/amber-documentation/issues

>
> So, as Amber gives direct access to the jQuery API, one can read form
> values as one would in jQuery.
>
> I am away from the dev box but this should help you getting started.
>
> FWIW I've started documentation works and there is a piece foreseen about
> that.
>
> HTH
> Phik
>
>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
> "amber-lang" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
> email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="hHhfxGIW9KwJ" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">amber-lang+...@googlegroups.com.
>> For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" onmousedown="this.href='https://groups.google.com/d/optout';return true;" onclick="this.href='https://groups.google.com/d/optout';return true;">https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups
> "amber-lang" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="hHhfxGIW9KwJ" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">amber-lang+...@googlegroups.com.
> For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" onmousedown="this.href='https://groups.google.com/d/optout';return true;" onclick="this.href='https://groups.google.com/d/optout';return true;">https://groups.google.com/d/optout.
>

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: get value of an input field (was Re: [amber-lang] Lack of Documentation)

philippeback


Le 21 déc. 2014 20:34, "Richard Eng" <[hidden email]> a écrit :
>
> Surprisingly, this works:
>
>> '#field1' asJQuery val.
>
>
> The reason is because the JavaScript function is val().

Great. All Javascript methods in jQuery are available to you this way.

Multi parameter functions are then mapped like:

aQuery.sampleFunc (a,b,c);

aQuery sampleFunc: a and: b and: c.

The and: can be whatever. The only thing that matters is mapping the function name.

Phil

Phil
>
>
> On Sunday, 21 December 2014 10:21:51 UTC-5, Hannes wrote:
>>
>> On 12/21/14, [hidden email] <[hidden email]> wrote:
>> > Le 21 déc. 2014 04:48, "Richard Eng" <[hidden email]> a écrit :
>> >>
>> >> I'm still having trouble grokking Amber. The severe lack of documentation
>> > is really holding me back. I'm just trying to get a handle on the basics of
>> > working with HTML elements such as forms and input fields. For example, how
>> > do I obtain the value that a user types into an input field? How do I go
>> > about processing a form?
>>
>> For example
>>
>>       (document getElementById: 'theIdOfMyInputField') value
>>
>>
>> >> We need more Amber examples that cover the basics of HTML and DOM
>> > elements.
>> >
>> > For most of the forms related things, I'd use jQuery facilities to access
>> > fields.
>> >
>> > #field1 asJQuery ...
>>
>>       #field1 asJQuery value
>>
>> gives an error message
>>
>>
>> Richard, your contribution is an important question. May I ask you to
>> open an issue at
>> https://github.com/amber-smalltalk/amber-documentation/issues
>>
>> >
>> > So, as Amber gives direct access to the jQuery API, one can read form
>> > values as one would in jQuery.
>> >
>> > I am away from the dev box but this should help you getting started.
>> >
>> > FWIW I've started documentation works and there is a piece foreseen about
>> > that.
>> >
>> > HTH
>> > Phik
>> >
>> >
>> >>
>> >> --
>> >> You received this message because you are subscribed to the Google Groups
>> > "amber-lang" group.
>> >> To unsubscribe from this group and stop receiving emails from it, send an
>> > email to [hidden email].
>> >> For more options, visit https://groups.google.com/d/optout.
>> >
>> > --
>> > You received this message because you are subscribed to the Google Groups
>> > "amber-lang" group.
>> > To unsubscribe from this group and stop receiving emails from it, send an
>> > email to [hidden email].
>> > For more options, visit https://groups.google.com/d/optout.
>> >
>
> --
> You received this message because you are subscribed to the Google Groups "amber-lang" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.