Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

In Mathematica 9, there's an interaction between InputField and Row. The following fragment (without or without Module and options):

  Module[{opts},
     opts = { FieldSize -> 10, FieldHintStyle -> {Black}, 
       Appearance -> Framed};
     Row[
      {InputField["", String, FieldHint -> "Field 1", opts],
       InputField["", String, FieldHint -> "Field 2", opts],
       InputField["", String, FieldHint -> "Field 3", opts]}]
     ]

Will correctly output the row of input fields and correctly handle text entered in the first field chosen by the user (not necessarily "Field 1"), but tabbing to and entering text in next field is converted to input form.

Whereas, removing Row, as in:

{InputField["", String, FieldHint -> "Field 1"],
 InputField["", String, FieldHint -> "Field 2"],
 InputField["", String, FieldHint -> "Field 3"]}

Results in correct operation (including tabbing across fields). Passing the above list to Panel, Column or Grid (make two sets lists) also works fine.

Known issue?

share|improve this question
add comment

1 Answer

I believe you need Deploy to keep the Row elements from being selectable.
Here in version 7 compatible format:

Module[{opts},
 opts = {FieldSize -> 10, Appearance -> Framed};
 Row[{
   InputField["", String, opts],
   InputField["", String, opts], 
   InputField["", String, opts]
 }] // Deploy
]
share|improve this answer
    
That works, but how ugly that it's necessary for Row and not Column or Grid? What's the reason? –  alancalvitti Aug 23 '13 at 20:37
    
@alan Well, Tab doesn't seem to move between the fields of a Column or Grid so you don't see this specific problem, but strictly speaking I think Deploy should be used with all three, as otherwise you can select and overwrite the fields. –  Mr.Wizard Aug 23 '13 at 20:43
    
I can tab between fields even if arranged with Column and Grid. –  alancalvitti Aug 23 '13 at 20:45
    
@alancalvitti I was suspecting that Grid will work while Column will show the same behavior as Row but now it's strange... –  Kuba Aug 23 '13 at 21:17
1  
The Row option Selectable -> False also seems to work. –  Michael E2 Aug 24 '13 at 3:40
show 3 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.