Autologin VBScript not working for PeopleSoft - vbscript

In Peoplesoft ERP, there are many Processes which need to be run manually, once you login into PeopleSoft. We intend to automate this process, using VBS, since it justs involves a few clicks. However, we stuck at the very first step, Login into the Peoplesoft. Below is the code as of now which we have tried. This opens the login page, but nothing further happens. Can someone help to log us in?
EDIT : We are in IE11
WScript.Quit Main
Function Main
Set IE = WScript.CreateObject("InternetExplorer.Application", "IE_")
IE.Visible = True
IE.Navigate "our URl"
Wait IE
Set Helem = IE.document.getElementByID("userid")
Helem.Value = "username"
Set Helem = IE.document.getElementByID("pwd")
Helem.Value = "password"
Set Helem = IE.document.Forms(0)
Helem.Submit
End Function
Sub Wait(IE)
Do
WScript.Sleep 500
Loop While IE.ReadyState < 4 And IE.Busy
Do
WScript.Sleep 500
Loop While IE.ReadyState < 4 And IE.Busy
End Sub
Sub IE_OnQuit
On Error Resume Next
WScript.StdErr.WriteLine "IE closed before script finished."
WScript.Quit
End Sub
Please find below the HTML code:
<html dir=ltr lang=en>
<head>
<title>Oracle PeopleSoft Sign-in</title>
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,user-scalable=yes">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="mobile-web-app-capable" content="yes">
<script language="JavaScript">
var sDomain = ";
try {
document.domain = ";
}
catch (err) {; }
</script>
<style id="ptfb" type="text/css">body{display:none;}</style>
<script type="text/javascript">
if (self === top) {
var fb = document.getElementById("ptfb");
fb.parentNode.removeChild(fb);
} else {
try {
top.location = self.location;
} catch(ex) {}
}
</script>
<link type="text/css" href="/PMXFGL01/signin.css" rel="stylesheet">
<script type="text/javascript" src="/PMXFGL01/signin.js"></script>
</head>
<body onload="ptSignon().login();">
<div id="pswrapper">
<form id="login" name="login" method="post" action="?&cmd=login&languageCd=ENG" autocomplete="off">
<input type="hidden" id="timezoneOffset" name="timezoneOffset" value="0">
<input type="hidden" id="ptmode" name="ptmode" value="f">
<input type="hidden" id="ptlangcd" name="ptlangcd" value="ENG">
<input type="hidden" id="ptinstalledlang" name="ptinstalledlang" value="GER,UKE,DAN,HUN,CFR,SLK,ENG,CZE,FRA,NOR,CRO,POR,ARA,ZHT,JPN,ZHS,RUS,POL,T HA,ITA,GRK,ROM,KOR,TUR,SER,SVE,ESP,DUT,MAY,BUL,HEB,FIN,VIE,SLV">
<div class="signonMain">
<img src="/PMXFGL01/images/Header.png" class="ps-staticimg" alt="Oracle PeopleSoft Sign-in" title="Oracle PeopleSoft Sign-in" >
<div class="ps_signinentry" >
<div id="ptloginerrorcont" class="ps_login_error" >
<div class="ps_login_error_inner" role="heading" aria-level="2">
<a id="error_link" name="error_link" tabindex="1"><img src="/PMXFGL01/images/PT_LOGIN_ERROR.gif" alt="Error"></a>
<div class="psloginerror" id="discovery_error" name="discovery_error" role="alert" aria-live="assertive" ></div>
<span class="psloginerror" id="login_error" name="login_error" role="alert" aria-live="assertive">User ID and Password are required.</span>
</div>
<div class="ps_box-control psloginerror" id="browsercheck_error" name="browsercheck_error" aria-live="assertive" role="alert"></div>
</div>
<div>
<span class="ps_label-show" id="ptLabelUserid"><label for="userid">User ID</label></span>
</div>
<div class="ps_box-control">
<input type="text" id="userid" name="userid" value="xxx" title="User ID">
</div>
<div>
<span class="ps_label-show" id="ptLabelPassword"><label for="pwd">Password</label></span>
</div>
<div class="ps_box-control">
<input type="password" id="pwd" name="pwd" title="Password" >
</div>
<div>
<span class="ps_label-show" id="ptLabelSelect"><label for="ps_select_box">Select a Language</label></span>
</div>
<div id="ps_select_parent" >
<div id= "ps_select_box" class="ps_box-control">
<select id="ptlangsel" name="ptlangsel" title="Select a Language" class="ps_select" onChange="ptSignon().changeLangFunc(this, event)">
<option value="ENG" title="English">English</option>
<option value="UKE" title="UK English">UK English</option>
<option value="ESP" title="Spanish">Español</option>
<option value="DAN" title="Danish">Dansk</option>
<option value="GER" title="German">Deutsch</option>
<option value="FRA" title="French">Français</option>
<option value="CFR" title="Canadian French">Français du Canada</option>
<option value="ITA" title="Italian">Italiano</option>
<option value="HUN" title="Hungarian">Magyar</option>
<option value="DUT" title="Dutch">Nederlands</option>
<option value="NOR" title="Norwegian">Norsk</option>
<option value="POL" title="Polish">Polski</option>
<option value="POR" title="Portuguese">Português</option>
<option value="ROM" title="Romanian">Română</option>
<option value="FIN" title="Finnish">Suomi</option>
<option value="SVE" title="Swedish">Svenska</option>
<option value="TUR" title="Turkish">Türkçe</option>
<option value="CZE" title="Czech">Čeština</option>
<option value="JPN" title="Japanese">日本語</option>
<option value="KOR" title="Korean">한국어</option>
<option value="RUS" title="Russian">Русский</option >
<option value="THA" title="Thai">ภาษาไทย</option>
<option value="ZHS" title="Simplified Chinese">简体中文</option>
<option value="ZHT" title="Traditional Chinese">繁體中文</option>
<option value="ARA" title="Arabic">العربية</option>
<option value="VIE" title="Vietnamese">Tiẽng Việt</option>
<option value="BUL" title="Bulgarian">български</option>
<option value="CRO" title="Croatian">hrvatski</option>
<option value="GRK" title="Greek">Ελληνικά</option>
<option value="HEB" title="Hebrew">עברית</option>
<option value="MAY" title="Bahasa Malay">Bahasa Melayu</option>
<option value="SER" title="Serbian">српски</option>
<option value="SLK" title="Slovak">slovenčina</option>
<option value="SLV" title="Slovenian">slovenščina</option>
</select>
</div>
</div>
<div class="ps_box-button">
<input name="Submit" type="submit" class="ps-button" value="Sign In" aria-label='To enable Accessibility mode, please check the checkbox "Enable Accessibility Mode" before you sign in. Sign In'>
</div>
<div class="ps_box-button">
<input type="checkbox" name="accessible" id="accessible">
<label for="accessible">Enable Accessibility Mode</label>
</div>
</div>
<div class="ps_box-link">
<span class="ps-link"></span>
</div>
<img src="/PMXFGL01/images/Footer.png" width="100%" alt="">
<footer id="ptfooter" class="ps_footer_text ">Copyright © 2000, 2015, Oracle and/or its affiliates. All rights reserved. </footer>
</div>
</form>
</div>
</body>
</html>

the following is working for me on IE11:
Function Main
Set IE = WScript.CreateObject("InternetExplorer.Application", "IE_")
IE.Visible = True
IE.Navigate "http://mysite/psp/myenvironment/?cmd=login"
Wait IE
With IE.Document
.getElementByID("userid").value = "myUsername"
.getElementByID("pwd").value ="myPassword"
.getElementsByName("Submit")(0).click
End With
End Function

Related

Mailchimp - Redirect to thank you page with embedded form

I followed the following post but the redirection is still not effective ...
Mailchimp - Redirect to thank you page
I can't find a way to make it work. The embedded form is embedded here on my website:
And the html code is:
<!-- Begin Mailchimp Signup Form -->
<link href="//cdn-images.mailchimp.com/embedcode/classic-10_7.css" rel="stylesheet" type="text/css">
<style type="text/css">
#mc_embed_signup{background:#fff; clear:left; font:14px Helvetica,Arial,sans-serif; }
/* Add your own Mailchimp form style overrides in your site stylesheet or in this style block.
We recommend moving this block and the preceding CSS link to the HEAD of your HTML file. */
</style>
<div id="mc_embed_signup">
<form action="https://travel-homes.us18.list-manage.com/subscribe/post?u=ab5689b8019de3c007fe4634b&id=84b4167b78" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
<div id="mc_embed_signup_scroll">
<h2>Main Guest</h2>
<div class="indicates-required"><span class="asterisk">*</span> indicates required</div>
<div class="mc-field-group">
<label for="mce-LNAME">Last Name <span class="asterisk">*</span>
</label>
<input type="text" value="" name="LNAME" class="required" id="mce-LNAME">
</div>
<div class="mc-field-group">
<label for="mce-FNAME">First Name <span class="asterisk">*</span>
</label>
<input type="text" value="" name="FNAME" class="required" id="mce-FNAME">
</div>
<div class="mc-field-group">
<label for="mce-EMAIL">E-mail <span class="asterisk">*</span>
</label>
<input type="email" value="" name="EMAIL" class="required email" id="mce-EMAIL">
</div>
<div class="mc-field-group">
<label for="mce-group[2217]">Apartment </label>
<select name="group[2217]" class="REQ_CSS" id="mce-group[2217]">
<option value=""></option>
<option value="1">Le Wilson</option>
<option value="2">Le Rebberg</option>
<option value="4">Le Bright'n Cosy|Comfy Studio - City Center</option>
<option value="8">L'Alsacien</option>
<option value="16">L'EastSide</option>
<option value="32">Le Pfeffel</option>
<option value="128">Le Bredele</option>
<option value="256">Colmar Unique Apartment</option>
</select>
</div>
<div id="mce-responses" class="clear">
<div class="response" id="mce-error-response" style="display:none"></div>
<div class="response" id="mce-success-response" style="display:none"></div>
</div> <!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
<div style="position: absolute; left: -5000px;" aria-hidden="true"><input type="text" name="b_ab5689b8019de3c007fe4634b_84b4167b78" tabindex="-1" value=""></div>
<div class="clear"><input type="submit" value="Send" name="subscribe" id="mc-embedded-subscribe" class="button"></div>
</div>
</form>
</div>
<!--End mc_embed_signup-->
I hope somebody can find a solution to this unsolvable issue.

AMP: How to submit form on change event with condition

I have couple linked dropdowns and want to prevent form submit on change event if linked dropdown is empty.
<form id="foo">
<select name="first" on="change:AMP.setState({settings: {first: event.value}}),foo.submit" >
...
</select>
<select name="second" on="change:AMP.setState({settings: {second: event.value}}),foo.submit" >
<option value=0> Please select </option>
...
</select>
</form>
Can i check state and then submit form if the value is appropriate? Something like:
<select name="first" on="change:AMP.setState({settings: {first: event.value}}),settings.second ? foo.submit : nothing to do" >
for the first dropdown to avoid form submit when I select new value, because second not welected yet.
Tried make it with validation, but it not work with dropdown, input works fine.
<input type="text"
id="show-first-on-submit-name"
name="name"
placeholder="Digit..."
required
on="change:AMP.setState({settings: {testing: event.value}}),requirements-form.submit"
pattern="^([1-9][0-9]*)$">
<span visible-when-invalid="valueMissing"
validation-for="show-first-on-submit-name"></span>
<span visible-when-invalid="patternMismatch"
validation-for="show-first-on-submit-name">
Please enter not '0'
</span>
<select name="purpose"
id="purpose"
pattern="^([1-9][0-9]*)$"
required
on="change:AMP.setState({settings: {purpose: event.value}}),requirements-form.submit">
<option value="0">Please select</option>
<option value="1">One</option>
</select>
<span visible-when-invalid="valueMissing"
validation-for="purpose">missing</span>
<span visible-when-invalid="patternMismatch"
validation-for="purpose">wrong</span>
Validating form by converting input status into an amp-state object and checking them when change event occurs is a little circuitous.
In my opinion it would be more easier to use HTML5 Form validation API (AMP use it as well) to handle input validation works. All you need to do is add required attribute to your <select> element and remove onChange validation logic.
Here is a simple example:
<!doctype html>
<html ⚡>
<head>
<meta charset="utf-8">
<title>My AMP Page</title>
<link rel="canonical" href="self.html" />
<meta name="viewport" content="width=device-width,minimum-scale=1">
<style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}#-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}#-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}#-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}#-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}#keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript>
<script async src="https://cdn.ampproject.org/v0.js"></script>
<script async custom-element="amp-form" src="https://cdn.ampproject.org/v0/amp-form-0.1.js"></script>
<style amp-custom>
h1 {
margin: 1rem;
}
</style>
</head>
<body>
<form target="_blank" action="/">
<select name="tier1" required>
<option value="">Please select</option>
<option value="opt1">tier1 - opt1</option>
<option value="opt2">tier1 - opt2</option>
</select>
<select name="tier2" required>
<option value="">Please select</option>
<option value="opt1">tier2 - opt1</option>
<option value="opt2">tier2 - opt2</option>
</select>
<input type="submit" value="submit" />
</form>
</body>
</html>
Example screenshot:

ajaxSubmit not working IE9. All other browsers seem fine

I have a simple (naked) MailChimp email signup form that I can't get to work in IE9. Every other browser seems fine. I know this question has been asked before but in various different circumstances. We are using JQuery Form Plugin.
<script type="text/javascript">
$(document).ready(function(){
$("#mc-embedded-subscribe-form").validate({
submitHandler: function(form) {
$(form).ajaxSubmit();
/*DO SOME OTHER STUFF*/
}
});
});
</script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<div id="mc_embed_signup">
<form action="//#####.us3.list-manage.com/subscribe/post?u=#############&id=##########" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
<div id="mc_embed_signup_scroll">
<h2>Subscribe to our mailing list</h2>
<div class="indicates-required"><span class="asterisk">*</span> indicates required</div>
<div class="mc-field-group">
<label for="mce-EMAIL">Email Address <span class="asterisk">*</span>
</label>
<input type="email" value="" name="EMAIL" class="required email" id="mce-EMAIL">
</div>
<div class="mc-field-group">
<label for="mce-FNAME">First Name <span class="asterisk">*</span>
</label>
<input type="text" value="" name="FNAME" class="required" id="mce-FNAME">
</div>
<div class="mc-field-group">
<label for="mce-MMERGE10">State </label>
<select name="MMERGE10" class="" id="mce-MMERGE10">
<option value=""></option>
<option value="NSW">NSW</option>
<option value="VIC">VIC</option>
<option value="QLD">QLD</option>
<option value="WA">WA</option>
<option value="ACT">ACT</option>
<option value="SA">SA</option>
<option value="NT">NT</option>
<option value="TAS">TAS</option>
</select>
</div>
<div id="mce-responses" class="clear">
<div class="response" id="mce-error-response" style="display:none"></div>
<div class="response" id="mce-success-response" style="display:none"></div>
</div> <!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
<div style="position: absolute; left: -5000px;"><input type="text" name="b_8bd18de15624fc1fb89b76d51_29d17890f0" tabindex="-1" value=""></div>
<div class="clear"><input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button"></div>
</div>
</form>
</div>

KendoUI mobile radio button group

I am trying to create a AppBuilder app and got stuck with a radio button group for a form. The example in http://demos.telerik.com/kendo-ui/mobile/forms/checkboxes.html shows listview. However since my form itself is a listview, the listview of radio buttons nested withint the form listview is not working. Is there any way that I can show the radio buttons?
Hi the following code might help you out
<!DOCTYPE html>
<html>
<head>
<title></title>
<link rel="stylesheet" href="http://cdn.kendostatic.com/2014.1.318/styles/kendo.common.min.css">
<link rel="stylesheet" href="http://cdn.kendostatic.com/2014.1.318/styles/kendo.default.min.css">
<link rel="stylesheet" href="http://cdn.kendostatic.com/2014.1.318/styles/kendo.mobile.all.min.css">
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="http://cdn.kendostatic.com/2014.1.318/js/kendo.all.min.js"></script>
<link rel="stylesheet" href="http://cdn.kendostatic.com/2014.1.318/styles/kendo.rtl.min.css">
<link rel="stylesheet" href="http://cdn.kendostatic.com/2014.1.318/styles/kendo.dataviz.min.css">
<link rel="stylesheet" href="http://cdn.kendostatic.com/2014.1.318/styles/kendo.dataviz.default.min.css">
</head>
<body>
<div id="forms" data-role="view" data-title="Form Elements" data-init="initForm" data-use-native-scrolling="true">
<form action="./index.html">
<ul data-role="listview" data-style="inset">
<li>
<label>Select element
<select>
<option value="First Option">First Option</option>
<option value="Second Option">Second Option</option>
<option value="Third Option">Third Option</option>
<option value="Fourth Option">Fourth Option</option>
</select>
</label>
</li>
<li>
<label>DropDownList
<select id="dropdown">
<option value="First Option">First Option</option>
<option value="Second Option">Second Option</option>
<option value="Third Option">Third Option</option>
<option value="Fourth Option">Fourth Option</option>
<option value="First Option">Fifth Option</option>
<option value="Sixth Option">Sixth Option</option>
</select>
</label>
</li>
<li>
<label>Slider
<input id="slider" type="range" max="100" />
</label>
</li>
<li>
<label>Type text
<input type="text" value="Text" />
</label>
</li>
<li>
<label>
Type password
<input type="password" value="password" />
</label>
</li>
<li>
<label>
Type search
<input type="search" value="search" />
</label>
</li>
<li>
<label>
Type url
<input type="url" value="http://www.telerik.com" />
</label>
</li>
<li>
<label>
Type email
<input type="email" value="kendoui#telerik.com" />
</label>
</li>
<li>
<label>
Type number
<input type="number" value="20" />
</label>
</li>
<li>
<label>
Type tel
<input type="tel" value="+44 22 11 10" />
</label>
</li>
<li>
<label>
Type date
<input type="date" value="2012-03-22" />
</label>
</li>
<li>
<label>
Type time
<input type="time" value="22:30" />
</label>
</li>
<li>
<label>
Type month
<input type="month" value="2012-01" />
</label>
</li>
<li>
<label>
Type datetime-local
<input type="datetime-local" value="2012-03-22T20:15" />
</label>
</li>
<li>
<label>
Textarea
<textarea style="resize: none">Multiline
Text</textarea>
</label>
</li>
<li data-layout="checklayout">
<ul data-role="listview" data-style="inset">
<li>
<label>
<input type="checkbox" checked="checked" />
Lettuce
</label>
</li>
<li>
<label>
<input type="checkbox" />
Carrots
</label>
</li>
<li>
<label>
<input type="checkbox" />
Peas
</label>
</li>
<li>
<label>
<input type="checkbox" />
Bread
</label>
</li>
<li>
<label>
<input type="checkbox" />
Unicorns
</label>
</li>
</ul>
</li>
</ul>
</form>
</div>
<script>
function initForm() {
var body = $(".km-pane");
if (kendo.ui.DropDownList) {
$("#dropdown").kendoDropDownList({
// The options are needed only for the desktop demo, remove them for mobile.
popup: {
appendTo: body
},
animation: {
open: {
effects: body.hasClass("km-android") ? "fadeIn" : body.hasClass("km-ios") || body.hasClass("km-wp") ? "slideIn:up" : "slideIn:down"
}
}
});
}
if (kendo.ui.Slider) {
$("#slider").kendoSlider({
tooltip: {
enabled: false
}
});
}
}
</script>
<script>
var app = new kendo.mobile.Application(document.body);
</script>
</body>
</html>

Validate register form

I am trying make a register form adn using jquery validation. I have a problem.
I want only one "warning message" for "birthday select box"..I couldnt manage this and it look terrible when i get 3x warning for each bday select box. How can i give "one" warning message if at least one box not choosed?
And my codes are below, i made it short and working for test:
<script language="JavaScript" type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
<script language="JavaScript" type="text/javascript" src="js/jquery.validate.js"></script>
<script>
$(document).ready(function(){
$.validator.addMethod("username", function(value, element) {
return this.optional(element) || /^[a-z0-9\_]+$/i.test(value);
}, "Username must contain only letters, numbers, or underscore.");
$("#regForm").validate();
});
</script>
</head>
<body>
<div>
<form method="post" id="regForm" action="register.php">
<div>
Name<br>
<input id="user_name" name="name" type="text" minlength="5" class="required username"/><br>
</div>
<div>
E-mail<br>
<input id="usr_email3" name="email" type="text" class="required email"/><br>
</div>
<div>
Password<br>
<input name="pass1" type="password" class="required password" minlength="5" id="pwd" /><br>
</div>
<div>
Confirm Password<br>
<input id="pwd2" name="pass2" class="required password" type="password" minlength="5" equalto="#pwd" /><br>
</div>
<div>
Birthday:
<select name="birthday_day" class="required">
<option value="">Day</option>
<option value="1" >1</option>
<option value="2" >2</option>
</select>
<select name="birthday_month" class="required">
<option value="">Month</option>
<option value="1" >January</option>
</select>
<select name="birthday_year" class="required">
<option value="">Year</option>
<option value="1900" >1900</option>
</select>
</div>
<div>
Gender:
<select name="gender" class="required">
<option value="">Choose</option>
<option value="Male">Male</option>
<option value="Female">Female</option><br /></div>
<br>
<div>
<input id="doRegister" name="doRegister" type="submit" value="Send"/>
</div>
</form>
</div>
Give an id to the div surrounding the birthday tags:
<div id="required">
Birthday:
<select name="birthday_day" class="required">
<option value="">Day</option>
<option value="1" >1</option>
<option value="2" >2</option>
</select>
<select name="birthday_month" class="required">
<option value="">Month</option>
<option value="1" >January</option>
</select>
<select name="birthday_year" class="required">
<option value="">Year</option>
<option value="1900" >1900</option>
</select>
</div>
Use the code below to apply a red border if any of the select tags are not selected:
$('#doRegister').click(function(){
var a = $('select[name="birthday_day"]').val();
var b = $('select[name="birthday_month"]').val();
var c = $('select[name="birthday_year"]').val();
if(a == '' || b == '' || c == '')
{
$('div#required').css('border', '1px solid f60f60');
}
else
{
$('div#required').css('border', 'none');
}
});
This,of course, avoids the use of the validator plugin that you're using

Resources