Home Advanced Request Offering
Options

Default values for Text Prompts

Brian_WinterBrian_Winter Customer Advanced IT Monkey ✭✭✭
edited May 2018 in Advanced Request Offering
Is there a way to set a default value in a Text Prompt for User Inputs?

Best Answer

Answers

  • Options
    Donson_PhamDonson_Pham Partner Advanced IT Monkey ✭✭✭
    Hi Brian, 

    I'm not too sure if i'm understanding.  You are not asking about making a prompt required, right?  What scenario do you have that you're trying to do? 
  • Options
    Brian_WinterBrian_Winter Customer Advanced IT Monkey ✭✭✭
    No, not required.  Pre-filled in with a default text value.  Here's the scenario:

    Have a drop-down - Employee or Vendor.

    For some inane reason, the form owner wants the next field to be Company.  
    If Vendor, then Company is blank.
    If Employee, then have the text, "Acme" in the Company field.  But still allow it to be overwritten.
  • Options
    Adam_DzyackyAdam_Dzyacky Product Owner Contributor Monkey ✭✭✭✭✭
    I don't think you can set default text values. But I do think there is a way to accomplish what you're after.

    What you're describing sounds doable with a Simple List (which translate to strings/text) so you're Simple List would contain "Employee or Vendor" this you could set a default value on. Then with ARO you can optionally display the Company name and make it a mandatory field. If an employee, with runbook automation you just set the Company name behind the scenes rather than solicit the input.
  • Options
    Brian_WinterBrian_Winter Customer Advanced IT Monkey ✭✭✭
    Close.  The form owner wants the Company Name field preset for all cases.  If Employee, it'll have the default value, but will be editable so it could be overwritten.  I think there are cases were an Employee is actually a Partner company than the main, parent.
  • Options
    David_Morris1David_Morris1 Member Advanced IT Monkey ✭✭✭
    the following tool box has the @Placeholder tag that will allow this, https://community.cireson.com/discussion/comment/14059#Comment_14059
    to get this to be dynamically populated i would suggest that you have two company fields in your form one that is blank and one that is using @placeholder and then use the advance request offering function to show one when Employee and one when vendor, once you have done this use the multiple mapping to add both fields to one text box in the SR since only one can be filled out dependent on the selection above
  • Options
    Brian_WinterBrian_Winter Customer Advanced IT Monkey ✭✭✭
    @David_Morris1 so close, too!  We use that toolbox in our environment (why Cireson hasn't integrated it yet is beyond me).  And when I heard of this requirement, I immediately thought of Placeholder.  Well, it turns out that Placeholder is not the actual value, so even though there's a grey text showing, if you submit the form, you get an empty string.  Or you get a Required error if its marked so.

    I then examined the field and found it to be a TextArea type input as defined below:

    <textarea class="k-textbox k-invalid input-ro form-control input-sm" id="textArea7186d4ed-7933-4757-94a0-864893f162ee" onkeyup="matchValues('7186d4ed-7933-4757-94a0-864893f162ee');" onpaste="pasteValue('7186d4ed-7933-4757-94a0-864893f162ee');" maxlength="2147483647" rows="1"></textarea>

    I can't inject text between the tags as is the typical answer and I haven't found a js snippet that will set the text even when I hard-code the id.  Granted my javascript skills are rusty.
Sign In or Register to comment.