Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

Refinements and Andrews ML Dialect

 [1/3] from: cybarite:sympatico:ca at: 15-Nov-2003 8:11

Refinements and Andrews ML Dialect I am using Andrews ML dialect and trying to set a radio button value based on some data input/type/name/value radio language english "English" input/type/name/value radio language french "Francais" and to pre-select one of them input/type/name/value radio language english "English" input/type/name/value/checked radio language french "Francais" but I want to display the value based on information on a database e.g. input/type/name/value/:checked-if-english radio language english "English" input/type/name/value/:checked-if-francais radio language french "Francais" I don't see how to set these under the ML dialect The problem seems to be that HTML just wants a "Checked" word. It treats Checked="Yes" Checked="No" Checked="No Really" as "Checked" And I don't know how to vary the refinement value of checked-if-english to be either "Checked" or null depending on a variable. mike m

 [2/3] from: AJMartin::orcon::net::nz at: 24-Dec-2003 22:47

Hi, Mike. You wrote:
> The problem seems to be that HTML just wants a "Checked" word.
That's right. Radio button tags have to have: checked="checked" to conform to XHTML and XML. HTML radio button tags just need: checked And most browsers will accept either and usually do the right thing. Here's what I came up with help fix the problem: Rebol [] English: false French: true Ook: false write File: %Checked.html ML compose/deep [ html [ head [ title "Checked" ] body [ h1 "Checked" form [ (either English [[input/checked/type/name/value checked ]][[input/type/name/value]]) radio language english "English" (either French [[input/checked/type/name/value checked ]][[input/type/name/value]]) radio language french "Francais" (either Ook [[input/checked/type/name/value checked ]][[input/type/name/value]]) radio language french "Ook!" ] ] ] ] browse File Of course, that's a little long and error prone to keep writing all the time. So, after a bit of thought: English: true French: false Ook: false Multilingual: true Check: func [Checked? [logic!] Dialect [path!]] [ either Checked? [ reduce [head insert next copy :Dialect 'checked "checked"] ] [ :Dialect ] ] write File: %Checked.html ML compose/deep [ html [ head [ title "Checked" ] body [ h1 "Checked" form [ (Check English 'input/type/name/value) radio language english "English" (Check French 'input/type/name/value) radio language french "Francais" (Check Ook 'input/type/name/value) radio language french "Ook!" (Check Multilingual 'input/type/name/value) checkbox multilingual multilingual "Multilingual?" ] ] ] ] browse File Note that the last option is a checkbox, not a radio button. I hope that helps! Andrew J Martin Speaking in tongues and performing miracles. ICQ: 26227169

 [3/3] from: antonr:iinet:au at: 16-Nov-2003 15:27

Maybe you can get your code ready like this: to-path compose [input type name (either true ['checked][]) donkey] ;== input/type/name/checked/donkey to-path compose [input type name (either false ['checked][]) donkey] ;== input/type/name/donkey You might have to wrap all that in another compose block so you can add the arguments, before doing it. Anton.