5
$\begingroup$

I see that FormFunction includes settings that could work, but I can't seem to find any way to get it to work within the "Ask" framework.

Related: https://reference.wolfram.com/language/tutorial/AdvancedWebFormCreation.html

Among many things that I tried, this does not work:

Ask[{responseName, prompt} -> <|Interpreter -> "String", 
     "Required" -> False|>];

It no longer warns that the field is required, but it repeats the Ask forever until the field is filled.

Thanks for any guidance!

$\endgroup$
  • $\begingroup$ Hi Kuba. Setting a default value is a step in the right direction, but different from making a field optional. It doesn't solve my issue in this case. I've continued to fiddle with it, but have not solved it. I don't think optional fields are supported yet. Thanks! $\endgroup$ – vonkohorn Dec 16 '16 at 15:44
  • $\begingroup$ But what exactly do you expect from optional field? You said it repeats the question, now it is solved. I know it is a trick but why doesn't it fit your needs? $\endgroup$ – Kuba Dec 16 '16 at 15:46
  • $\begingroup$ I was hoping that the user could leave that paricular field blank and proceed the the form. $\endgroup$ – vonkohorn Dec 17 '16 at 17:52
  • $\begingroup$ But user can leave it blank. $\endgroup$ – Kuba Dec 17 '16 at 17:57
2
$\begingroup$

Default value syntax works here too so you can use it:

CloudDeploy[
 AskFunction[Ask["key" -> "String" -> "default"]]
]

If you want to check whether one skipped that entry you can use unique or empty string there and match after submission.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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