M
Michael campbell
How does one control whether or not a checkbox is "checked" using amrita? I'm familiar with using the aattr => value) form for modifying an attribute WITHIN a tag, but this attribute is either present or absent, it doesn't have a value as such.
If I leave out the symbol, the entire tag is eliminated, not just the attribute within it.
Below, the "1" form is printed with "checked=on" as expected; the "2" form prints nothing; the entire text from <form> to </form> is eliminated, when all I want is the "checked" attribute WITHIN the <form..> tag to go away, not the whole thing.
Thoughts welcome.
require 'amrita/template'
include Amrita
t = TemplateText.new <<-html
<form method=post action=DYNAMIC_CONTENT_NEEDS_TO_BE_PLACED_HERE checked id=form>
<input type=text name=foobar>
</form>
html
data = {
:form => aaction => 'myform.cgi', :checked => "on")
}
puts "1"
t.expand(STDOUT, data)
puts "2"
data = {
:form => aaction => 'myform.cgi')
}
If I leave out the symbol, the entire tag is eliminated, not just the attribute within it.
Below, the "1" form is printed with "checked=on" as expected; the "2" form prints nothing; the entire text from <form> to </form> is eliminated, when all I want is the "checked" attribute WITHIN the <form..> tag to go away, not the whole thing.
Thoughts welcome.
require 'amrita/template'
include Amrita
t = TemplateText.new <<-html
<form method=post action=DYNAMIC_CONTENT_NEEDS_TO_BE_PLACED_HERE checked id=form>
<input type=text name=foobar>
</form>
html
data = {
:form => aaction => 'myform.cgi', :checked => "on")
}
puts "1"
t.expand(STDOUT, data)
puts "2"
data = {
:form => aaction => 'myform.cgi')
}