- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2019 07:08 PM
Hi all,
I'm building a custom widget to present a custom form in Service Portal, and need to build a Select Box type variable...and I'm struggling with the script in the HTML field of the widget. Here's where I'm at so far, I got this from Stackoverflow.com and am trying to manipulate for my need. Anyone done this before? Thanks!
<div class="select">
<select [(ngModel)]="corporationObj" class="form-control col-lg-8" #corporation required>
<option *ngFor="let corporation of corporations"></option>
</select>
</div>
Solved! Go to Solution.
- Labels:
-
Service Portal Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2019 12:17 AM
<div class="form-group">
<label for="technology">What technology is this related to?</label>
<select id="technology" name="technology"
ng-model="c.data.technology" class="form-control">
<option value="">--None--</option>-->
<option value="1">Help Desk</option>
<option value="2">IT</option>
<option value="3">Payroll</option>
</select>
</div>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2019 11:10 PM
For that, you have to write your own code inside the client and server script according to your requirement.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2019 11:13 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2019 11:15 PM
that is so funny...that's exactly where I started! Ha...well thanks so much...you've been extremely helpful. Any thoughts on how to get the fields to be mandatory?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2019 11:22 PM
Nathan's client controller script for the sn-record-picker looks like this on that page...I'm a little lost as to what to do with it for my needs...any suggestions?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2019 12:06 AM
thanks again for all your help Shweta...I want to mark your answer as correct, so here was the script that actually answered my question about how to create a Select Box variable...so if you want to copy and paste this script in one more reply I'll mark your answer correct. thanks for all the extra help too!
SCRIPT TO CREATE A SELECT BOX TYPE VARIABLE ON A CUSTOM FORM WIDGET. ENTER IN THE WIDGET'S HTML FIELD.
PASSES THE VALUE FROM THE SELECT BOX TO THE WIDGET'S CLIENT SCRIPT AS "c.data.technology" (in this example)
<div class="form-group">
<label for="technology">What technology is this related to?</label>
<select id="technology" name="technology"
ng-model="c.data.technology" class="form-control">
<option value="">--None--</option>-->
<option value="1">Help Desk</option>
<option value="2">IT</option>
<option value="3">Payroll</option>
</select>
</div>