0% found this document useful (0 votes)
127 views

Titket Coding

This document contains code for automatically filling out and submitting an online form. It gets references to all the form fields and sets their values programmatically. It finds fields like name, age, gender, stations, date and sets example values. It also clicks on buttons like submit or continues. The purpose is to automate form filling and submission through scripting.

Uploaded by

seyedm1983
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
127 views

Titket Coding

This document contains code for automatically filling out and submitting an online form. It gets references to all the form fields and sets their values programmatically. It finds fields like name, age, gender, stations, date and sets example values. It also clicks on buttons like submit or continues. The purpose is to automate form filling and submission through scripting.

Uploaded by

seyedm1983
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

javascript:function E() {userId = document.

getElementById("userId");pwd =
document.getElementById("pwd");fromStation =
document.querySelectorAll("[placeholder='From*']")[0];toStation =
document.querySelectorAll("[placeholder='To*']")[0];journeydate =
document.querySelectorAll("[placeholder='Journey Date(dd-mm-yyyy)*']")[1];flexiDate
= document.getElementById("dateSpecific");fpsgname =
document.querySelectorAll("[id='psgn-name']");fpsgage =
document.querySelectorAll("[formcontrolname='passengerAge']");fpsggender =
document.querySelectorAll("[formcontrolname='passengerGender']");fpsgberthchoice =
document.querySelectorAll("[formcontrolname='passengerBerthChoice']");passFoodChoic
e = document.querySelectorAll("[formcontrolname='passengerFoodChoice']");fsrctzn =
document.querySelectorAll("[id='srctzn-option']");childBerthFlag =
document.querySelectorAll("[formcontrolname='childBerthFlag']");childName =
document.querySelectorAll("[id='infant-name']");childAge =
document.querySelectorAll("[formcontrolname='age']");childGender =
document.querySelectorAll("[formcontrolname='gender']");mobileNumber =
document.getElementById("mobileNumber");gstnumber = document.getElementById("gstin-
number");autoUpgradation = document.getElementById("autoUpgradation");confirmberths
= document.getElementById("confirmberths");nginvalid =
document.getElementsByClassName(".ng-invalid");transPassword =
document.querySelectorAll("[formcontrolname='txnPassword']");reservationChoice =
document.querySelectorAll("[formcontrolname='reservationChoice']");for (var i = 0;
i < nginvalid.length; i++) {nginvalid[i].classList.remove('ng-
invalid');nginvalid[i].classList.add('ng-valid');}function F1(el, val) {if
(document.getElementById(el) && val != '') document.getElementById(el).value = val;
}if (document.forms['loginFormId']) {};if(fromStation){ fromStation.value =
'TIRUNELVELI - TEN'; fromStation.dispatchEvent(new Event('keydown'));
fromStation.dispatchEvent(new Event('input')); }if(toStation){ toStation.value =
'DADAR - DDR'; toStation.dispatchEvent(new Event('keydown'));
toStation.dispatchEvent(new Event('input')); toStation.click(); }if(journeydate)
{ journeydate.value = '23-11-2018'; journeydate.dispatchEvent(new
Event('keydown')); journeydate.dispatchEvent(new Event('input')); }if(fpsgname[0]){
fpsgname[0].value = 'SEYED MOHAMED'; fpsgname[0].dispatchEvent(new
Event('input'));}if(fpsgage[0]) { fpsgage[0].value = '36';
fpsgage[0].dispatchEvent(new Event('input'));}if(fpsggender[0])
{ fpsggender[0].value = 'M'; fpsggender[0].dispatchEvent(new Event('change')); }
if(fpsgberthchoice[0]) { fpsgberthchoice[0].value = 'SL';
fpsgberthchoice[0].dispatchEvent(new Event('change'));}if (mobileNumber)
{ mobileNumber.value = '9042180155'; mobileNumber.dispatchEvent(new
Event('change')); } if(document.getElementById('r4'))
{ document.getElementById('r4').checked = true; }
if(document.getElementById('travelInsuranceOptedYes'))
{ eval(document.getElementById('travelInsuranceOptedYes').click()); }try
{ if(document.getElementById('ui-tabpanel-7-
label'))eval(document.getElementById('ui-tabpanel-7-label').click());} catch (err)
{}try
{ if(document.getElementById('credit_39'))document.getElementById('credit_39').clic
k();} catch (err) {}transPassword[0].value = 'mosaMd1983';
transPassword[0].dispatchEvent(new Event('input'));}E()

You might also like