- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-09-2017 03:54 PM
Greetings,
I'm having trouble getting the processing script to engage in my instance. Basic functionality I'm looking for is a form button that pops up a window asking how many runs they'd like to execute which updates a field in the current form. Then a server side script executes. That's it!
I'm calling a UI page from a UI action. I believe the problem resides in the client script in the UI page but I can't find out where it is.
UI Action Details:
Name: Start Runs
Active enabled
Form Button enabled
Client enabled
OnClick: Onclick = numRunsDialog()
Client Script
function numRunsDialog(){
var dialog = new GlideDialogWindow('loadsim_start_runs');
dialog.render();
}
UI Page Details:
Name: loadsim_start_runs
Application: Global
Catagory: General
HTML:
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<section class="textarea_holder">
<p>Please set number of runs to execute</p>
<textarea rows="1" name="dialog_numRuns" id="dialog_numRuns" label="" value="" mandatory="true" class="form-control"/>
</section>
<br></br>
<section class="button_holder">
<button onclick="return validateNumRuns()">Submit</button>
</section>
</j:jelly>
Client Script:
function validateNumRuns() {
//Make sure there are comments to submit
var numRuns = gel("dialog_numRuns").value;
numRuns = trim(numRuns);
//If less than 1, alert the user and stop submission
if (numRuns < 1 || numRuns > 10 ) {
alert("Please enter number of runs (max 10).");
return false;
}
//If there is input, close the dialog window and submit them
g_form.setValue("u_num_runs", numRuns); //Set the u_num_runs with value from the dialog
g_form.save();
}
Processing Script:
gs.print('testing');
As you can see my current processing script is extremely simple (it used to be big but I trimmed it way down for debugging). I think there is an issue with the client script but I can't figure it out (have dumbed it down significantly to get to this point).
Please advise and I will give MANY UPVOTES!
Thanks,
Ryan
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-12-2017 02:54 PM
Answering my own question here. The problem was that I was missing the <g:ui_form> tag. Apparently leaving that tag off the HTML, causes the UI page to ignore the processing script.
Here is a fixed version of the HTMl field from my UI Page (added tags in bold).
HTML:
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g:ui_form>
<section class="textarea_holder">
<p>Please set number of runs to execute</p>
<textarea rows="1" name="dialog_numRuns" id="dialog_numRuns" label="" value="" mandatory="true" class="form-control"/>
</section>
<br></br>
<section class="button_holder">
<button type="submit" onclick="return validateNumRuns();">Submit</button>
<input type="text" id="hidden1" value=""></input>
</section>
</g:ui_form>
</j:jelly>
Hopefully this answer is useful to someone other than me!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-12-2017 02:54 PM
Answering my own question here. The problem was that I was missing the <g:ui_form> tag. Apparently leaving that tag off the HTML, causes the UI page to ignore the processing script.
Here is a fixed version of the HTMl field from my UI Page (added tags in bold).
HTML:
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g:ui_form>
<section class="textarea_holder">
<p>Please set number of runs to execute</p>
<textarea rows="1" name="dialog_numRuns" id="dialog_numRuns" label="" value="" mandatory="true" class="form-control"/>
</section>
<br></br>
<section class="button_holder">
<button type="submit" onclick="return validateNumRuns();">Submit</button>
<input type="text" id="hidden1" value=""></input>
</section>
</g:ui_form>
</j:jelly>
Hopefully this answer is useful to someone other than me!
