# Amrita : how to define the field VALUE of the tag INPUT

**URL:** <https://www.ruby-forum.com/t/amrita-how-to-define-the-field-value-of-the-tag-input/140698>\
**Category:** Ruby\
**Created:** [June 17, 2008, 5:45pm UTC](https://www.ruby-forum.com/t/amrita-how-to-define-the-field-value-of-the-tag-input/140698 "2008-06-17T17:45:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![randy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/2acd7d/32.png) [@randy](https://www.ruby-forum.com/u/randy)\
**Post date:** [June 17, 2008, 5:45pm UTC](https://www.ruby-forum.com/t/amrita-how-to-define-the-field-value-of-the-tag-input/140698/1 "2008-06-17T17:45:56Z")

</div>

Hello,

I’m using Amrita to build a FORM with some “\<INPUT …\>” fields, I  
don’t know how to define  
an identifier for the default value of this input, the field “value”.

The following line don’t woks :

\< INPUT type=“text” value= id=my\_value /\>

With my browser, I can obtain in the field :

- an empty field;
- an empty field plus a text field (the value of ‘my\_value’;
- ‘id=my\_value’ …

Someone can help me ?

Thanks

Have a good day.

Randy

---

<div class="post-metadata">

**Author:** ![randy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/2acd7d/32.png) [@randy](https://www.ruby-forum.com/u/randy)\
**Post date:** [June 18, 2008, 10:04am UTC](https://www.ruby-forum.com/t/amrita-how-to-define-the-field-value-of-the-tag-input/140698/2 "2008-06-18T10:04:25Z")

</div>

Randy wrote:

> Hello,
> 
> I’m using Amrita to build a FORM with some “\<INPUT …\>” fields, I  
> don’t know how to define  
> an identifier for the default value of this input, the field “value”.

I’m not quite sure what you are wanting to do as you only gave an html  
fragment. However, I am guessing you want to do something like this:

require “amrita/template”  
s = “”  
template = Amrita::TemplateText.new(s)  
template.expand(STDOUT, { :my\_value =\> Amrita.a(:value =\> ‘a default’)})

---

<div class="post-metadata">

**Author:** ![randy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/2acd7d/32.png) [@randy](https://www.ruby-forum.com/u/randy)\
**Post date:** [June 18, 2008, 11:30am UTC](https://www.ruby-forum.com/t/amrita-how-to-define-the-field-value-of-the-tag-input/140698/3 "2008-06-18T11:30:57Z")

</div>

Hi Paul,

On 18 juin, 10:02, Paul McMahon [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> However, I am guessing you want to do something like this:

You 're right !

Thanks for your reply, I can continue my work 🙂

Have a good day.

Randy
