JavaScript - Javascript : Sendkeys Issue - Screen Scraping Citrix Application
Hello all,
I want to screen scrape a citrix application using server side java script. Currently I am making use of WScript.Shell ActiveXObject and try the following : var objShell =new ActiveXObject("WScript.Shell"); objShell.AppActivate("Metaframe Presentation Server"); // this is the title of the citrix dialog that opens up once the application gets launched. objShell.SendKeys ("{ENTER}") Using AppActivate, the focus is transferred to the dialog mentioned above, but then the SendKeys do not work. Do I need to do it differently? Please provide your valuable help. Similar TutorialsCurrently I have a .vbs script that I am using to auto login to a site. I know its not javascript but the site itself is and thats what causing my issue I think? The site is a reservation site for classes at the gym. Basically I want the script to login to the site and sign up for a specific class every week. Its the same class same time same day. Below is the code I have so far. I can't figure out what the "sign up" button sends for me to add it into the script.
Code: set a = createobject("wscript.shell") a.run "https://clients.mindbodyonline.com/ASP/home.asp?studioid=6268/" wscript.sleep (5000) a.sendkeys ("khigbie") a.sendkeys chr(9) wscript.sleep (2000) a.sendkeys ("ilovelamp11") a.sendkeys "{Enter}" call msgbox("Finished") wscript.quit I'm not sure if it helps but I pulled the source from the page when logged in... Code: <!-- CLISRV0107 --> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd"> <html> <head> <title>The Edge Fitness Clubs Online</title> <meta http-equiv="Content-Type" content="text/html" /> <link rel="icon" href="/favicon.ico" /> <link rel="shortcut icon" href="/favicon.ico" /> <script type="text/javascript" src="/work/scripts/jquery-1.4.2.js"></script><script type="text/javascript" src="/work/scripts/error.js"></script><script type="text/javascript" src="/work/scripts/mb.js"></script><script type="text/javascript" src="/work/scripts/home.js"></script> <script type="text/javascript"> var js_studioid = "6268"; var dis_array = {0:'Room', 1:'Class Type', 2:'Session Type', 3:'Workshops', 4:'Appointments', 5:'Classes', 6:'Teacher', 7:'Program', 8:'Location', 9:'Booked', 10:'Completed', 11:'Confirmed', 12:'Client', 13:'Assistant', 14:'Rentals', 15:'Assistant2', 16:'Arrived', 17:'Check Out', 18:'Instructor', 19:'Program', 20:'Company', 21:'Reserved', 22:'Total', 23:'Client', 24:'Help', 25:'Online Store', 26:'Current Series', 27:'Payment', 28:'Event', 29:'Balance', 30:'Credit', 31:'Debit', 32:'Remaining', 33:'Unbooked', 34:'Purchased', 35:'Amount', 36:'Paid', 37:'Payment Ref #', 38:'Back', 39:'Email Address', 40:'Name', 41:'Username', 42:'Password', 43:'Home Studio', 44:'Billing Name', 45:'Billing Address', 46:'Address', 47:'City', 48:'State', 49:'Postal Code', 50:'CC Type', 51:'CC Number', 52:'CC Expiration', 53:'Edit', 54:'Web', 55:'Cancel', 56:'At', 57:'Date', 58:'Time', 59:'Payment Method', 60:'Status', 61:'Series', 62:'Account', 63:'Current', 64:'Expiration Date', 65:'Description', 66:'Sale Date', 67:'Color', 68:'Location', 69:'Price', 70:'Quantity', 71:'Tax', 72:'Amount Paid', 73:'Details', 74:'Info', 75:'Size', 76:'Start Time', 77:'Start Date', 78:'End Time', 79:'End Date', 80:'First Name', 81:'Last Name', 82:'Home Phone', 83:'Mobile Phone', 84:'Work Phone', 85:'Business Phone', 86:'Business Address', 87:'Business Email', 88:'Account Information', 89:'Billing Information', 90:'Notes', 91:'Country', 92:'Click Here', 93:'Phone #', 94:'Login', 95:'Discount', 96:'Class Level', 97:'Sales Tax', 98:'Tax 2', 99:'Tax 3', 100:'Tax 4', 101:'Tax 5', 102:'', 103:'', 104:'', 105:'', 106:'', 107:'', 108:'Rep', 109:'ACH', 110:'Rep 2', 111:'Rep 3', 112:'Contract Deposit', 113:'Teachers', 114:'Instructors', 115:'Sale ID', 116:'Sold By', 117:'Exp', 118:'Subtotal', 119:'Rep 4', 120:'Rep 5', 121:'Rep 6', 122:'Insurance Company', 123:'Insurance Policy #', 124:'Birthday', 125:'Question', 126:'Test', 127:'Referral Type', 128:'Remember Me', 129:'Previous Day', 130:'Today', 131:'Next Day', 132:'Last Week', 133:'Next Week', 134:'ID', 135:'Session Type Level', 136:'Search', 137:'Appointment', 138:'Male', 139:'Female', 140:'Date', 141:'Time', 142:'Class/Session Level', 143:'Yes', 144:'No', 145:'CVV2', 146:'Cardholder Name', 147:'Check', 148:'Uncheck', 149:'All', 150:'None', 151:'Substitute', 152:'Sun', 153:'Mon', 154:'Tue', 155:'Wed', 156:'Thu', 157:'Fri', 158:'Sat', 159:'View', 160:'Update', 161:'From', 162:'To', 163:'Partner', 164:'Purchases', 165:'Fee', 166:'Contact', 167:'Submit', 168:'Gender Preference', 169:'Next', 170:'OR', 171:'Open', 172:'Late Cancel', 173:'Unconfirmed', 174:'Week', 175:'January', 176:'February', 177:'March', 178:'April', 179:'May', 180:'June', 181:'July', 182:'August', 183:'September', 184:'October', 185:'November', 186:'December', 187:'Auto Pays', 188:'Contract', 189:'Print', 190:'Enroll', 191:'Add', 192:'in', 193:'This Month', 194:'This Week', 195:'Memberships', 196:'&', 197:'Contracts', 198:'Packages', 199:'Days', 200:'Book', 201:'Rep1', 202:'Class', 203:'Workshop', 204:'Middle Name', 205:'Nickname', 206:'Back Bar Charge', 207:'County', 208:'Commission', 209:'Commission2', 210:'Locker #', 211:'Emergency Contact Information', 212:'Name', 213:'Relationship', 214:'Phone', 215:'Email', 216:'Select', 217:'Item', 218:'Type', 219:'Conversions', 220:'Members', 221:'Non-Members', 222:'Company', 223:'Prospects', 224:'Costume', 225:'Costumes', 226:'Generate', 227:'Gender', 228:'Relationship', 229:'Waist', 230:'Hip', 231:'Girth', 232:'Inseam', 233:'Head', 234:'Shoe', 235:'Tights', 236:'Height', 237:'Bust', 238:'Prefix', 239:'Active', 240:'InActive', 241:'Legal Name', 242:'STAFF ALERT', 243:'Alert', 244:'Select State/Prov', 245:'Date Range', 246:'n/a', 247:'Owner', 248:'Age', 249:'Years', 250:'Months', 251:'Formula', 252:'Referral Discount', 253:'Termination Code', 254:'Termination Comments', 255:'Day', 256:'Semester', 257:'Year', 258:'Month', 259:'Quarter'}; var mbo_scd = '4/13/2009'; </script> <link rel="stylesheet" type="text/css" href="/work/styles/jquery.tooltip.css" /><link rel="stylesheet" type="text/css" href="/work/styles/base/jquery.ui.all.css" /><script type="text/javascript" src="/work/scripts/jquery-1.4.2.js"></script><script type="text/javascript" src="/work/scripts/plugins/jquery.cookie-1.0.js"></script><script type="text/javascript" src="/work/scripts/plugins/jquery.mb.js"></script><script type="text/javascript" src="/work/scripts/jquery-ui-1.8.4.custom.js"></script><script type="text/javascript" src="/work/scripts/plugins/jquery.tooltip.js"></script><script type="text/javascript" src="/work/scripts/plugins/jquery.ba-resize.js"></script><script type="text/javascript" src="/work/scripts/plugins/jquery.lightboxLib.js"></script> <script type="text/javascript"> $(function() { // init tooltips $("img[title],span[title],select[title],input[title],legend[title]").tooltip({ track: true, showURL: false, fade: 250 }); $('fieldset.collapsible').setCollapseEvents(); }); </script> <!-- MBO's analytics code DevItem R58_3856--> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-31442-3']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> <script type="text/javascript"> function resetSession() { alert("Your session has expired, redirecting home."); parent.location = "/ASP/logout.asp?studioid=6268" } </script> <script type="text/javascript"> var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); </script> <script type="text/javascript"> try { var pageTracker = _gat._getTracker("UA-31442-3"); pageTracker._trackPageview(); } catch (err) { } </script> </head> <script type="text/javascript"> var mbo_scd = '4/13/2009'; </script> <frameset id="mainFrameset" rows="98,*" frameborder="0" framespacing="0" NORESIZE> <frame name="topFrame" src="top_class.asp?tg=0&vt=&lvl=&view=&trn=&date=&loc=&page=&pMode=&prodid=&stype=-7&classid=&catid=&justloggedin=" frameborder="0" noresize scrolling="NO" > <frame name="mainFrame" src="main_class.asp?tg=0&vt=&lvl=&view=&trn=&date=&loc=&page=&pMode=&prodid=&stype=-7&classid=&catid=&justloggedin=" frameborder="0" scrolling="YES"> </frameset> <noframes> <body style="background-color:#FFFFFF;" text="#000000"> </body> </noframes> </html> Thanks for any help!! Hi, We are having a website which shows the HTML5 video once click on the Video link it display the video in the same page where the innerhtml of the div accept it. document.getElementById("video_div").innerHTML = QT_WritePoster_XHTML('Click to Play', tabs[currentTab].articles[currentArticle].video+'-poster.jpg',tabs[currentTab].articles[currentArticle].video+'.mov',536, 256, '','controller', 'true','autoplay', 'true','bgcolor', 'black','scale', 'aspect'); It display the video in all the browser accept Safari and in IPhone. Once this QT_WritePoster_XHTML line is encountered while clicking on the Video link of the application it opens the video mentioned in the QT_WritePoster_XHTML on the new blank video but not in the innerhtml with the Application. Please let us know what to do to support this code with the application. Please note that this problem is coming only for Safari Apple. Thanks in advance. Hello, I need your help, I have the following code below, and its giving me an error saying: "The system cannot find the file specified". Code: <html> <script language="javascript" type="text/javascript"> function start_ccm(){ var wsh = new ActiveXObject('WScript.Shell'); wsh.exec("C:\Program Files\WorkDynamics Technologies\ccmApplications\ccmMercury.exe") } </script> </head> <body> <input id="Button1" onclick="start_ccm()" type="button" value="START" /> </body> </html> There is nothing wrong with the location, but my best guess are the spaces in the file path. Any help with this is greatly appreciated. Cheers, J If I want to launch an application in DOS it is START notepad.exe How do I launch the application in Javascript? thanks I want to have another go at Javascript. I have several books on the subject but I find that my eyesight is a major problem. Therefore I want to try an on-line solution, preferably free. I have Googled, but there are so many that I am almost dizzy with the choices. Perhaps someone could recommend one. Not too fussy visually. My knowledge is VERY basic. Frank Hi, I want a link on my website where when you press it, it print screens. somthing like, <a href=printscrn();">Print Screen</a> anyone any ideas? Simon I have set javasscript code to detect and store into variable screen resolution. How to store this javascript into variable PHP? PHP Code: <script type="text/javascript"> var ScreenWidth=screen.width; var ScreenHeight=screen.height; var ScreenResolution=ScreenWidth+"x"+ScreenHeight; document.write("<span style=\"color:red;text-transform: capitalize;\">your current screen resolution is " + ScreenResolution + "</span>"); --></script> } </script> <?PHP $screen=str_replace("#","",$resolution); echo "screen width is:".$screen; ?> Hi, I am an asp.net developer and I wanted to display user popup (kind of) which freezes the screen so that user won't click anything else on the screen. There are some predefined controls in asp.net, but I wanted do this using Javascript. Where can I find a sample with code? Thanks This is what I tried but alas, it does not work por que no? This is located on my main index file which if the result of z is greater than 1, I would have the user stay at this page as opposed to redirecting to the portrait design. I have optimized the website for mobile use so there is a reason of having two different pages, the wide screen has extra tools / other stuff that isn't shown on the portrait not because of size/responsive design but becasue I want it to be this way. Anyway... "What's the situation captain?" This is located above my <style> tag Code: <script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script> <script language="JavaScript" type="text/javascript"> <script> function redirect() { var x = screen.width; var y = screen.height; var z = x/y; if (z<1) { window.location.replace("alternate destination"); }; else ( ){ // stay here }; }; </script> Reply With Quote 12-21-2014, 01:58 AM #2 Old Pedant View Profile View Forum Posts Supreme Master coder! Join Date Feb 2009 Posts 28,311 Thanks 82 Thanked 4,754 Times in 4,716 Posts You have extra semicolons in there. In general, don't put a semicolon directly after a right brace }; There are a couple of exceptions, but they don't apply here. What's the point in having the else?? I just found this web scraping tool at http://www.heliumscraper.com and I was wonderin if anyone have used it. They say on the web page you can automate it with JavaScript.
I have a big issue. I am doing this: I have a menu and when you click tje linsk it loads content using jquery post into a div. It alway loads javascript with it. But I find when they click another menu item it loads a different section into the div along with different javascript. But the dom is still keeping the old javascript. After about 40 clicks the site wants to stop working. How can I resolve this? Thanks Hi I am trying to build an application which has 6 small input fields and one numeric key pad. Initially the focus should be on the first inputfield and after entering the number from the numeric key pad, it should shift the focus to third input field and the user should be able to enter the number from the numeric key pad and then shift the focus to fifth input field and user should be able to enter the number in fifth through the key pad. I have achieved till gaining the focus on the first input field and i could enter the number through the key pad and i was able to shift the focus to third input field but however whatever i enter the number is getting changed in first and third input field. the code i wrote is below Code: <html> <head> <script type="text/javascript"> function displaymessage(val) { document.getElementById('first').value = val; alert(document.getElementById('first').value); if(document.getElementById('first').value!=null) { alert("yes"); document.getElementById('third').focus(); document.getElementById('third').value = val; } } </script> </head> <body onload="document.getElementById('first').focus();"> Enter your pin: <input type="text" id="first" size="1" maxlength="1"></> <input type="text" id="second" size="1" maxlength="1" /> <input type="text" id="third" size="1" maxlength="1" /> <input type="text" id="fourth" size="1" maxlength="1" /> <input type="text" id="five" size="1" maxlength="1" /> <input type="text" name="six" size="1" maxlength="1" /> <table border="1"> <tr> <td width="30px" align="center"><input type="button" value="1" onclick="displaymessage(1)"/> </td> <td width="30px" align="center"><input type="button" value="2" onclick="displaymessage(2)"/> </td> <td width="30px" align="center"><input type="button" value="3" onclick="displaymessage(3)"/> </td> </tr> <tr> <td width="30px" align="center"><input type="button" value="4" onclick="displaymessage(4)"/> </td> <td width="30px" align="center"><input type="button" value="5" onclick="displaymessage(5)"/> </td> <td width="30px" align="center"><input type="button" value="6" onclick="displaymessage(6)"/> </td> </tr> <tr> <td width="30px" align="center"><input type="button" value="7" onclick="displaymessage(7)"/> </td> <td width="30px" align="center"><input type="button" value="8" onclick="displaymessage(8)"/> </td> <td width="30px" align="center"><input type="button" value="9" onclick="displaymessage(9)"/> </td> </tr> </tr> <tr> <td width="30px" align="center"><input type="button" value="0" onclick="displaymessage(0)"/> </td> <td width="30px" align="center"><input type="button" value="Reset"/> </td> </tr> </table> </body> </html> I know thats because I am filling the val variable again in the third input field and that is the reason it is getting changed in first and third. However I am not aware of what other best methods we could use on this. Pleasee helpp.. Happy Star Wars Day! Hopefully someone is strong in the force and can help. I have a HTML form and I need to get the user to select one of 350 options. I have broken down the options into "Major Group", "Sub-Major Group", "Minor Group" and "Unit" I'm looking to create 4 dynamically changing drop down lists to point the user to their final choice. All 350 options are in one database table with the following headings: [Major Group][Major Group Title][SubMajor Group][SubMajor Group Title][Minor Group][Minor Group Title][Unit][Unit Title] The 'groups' are numeric, and the title's alphanumeric. I have used the MySQL database to achieve this as it makes it easier to update the 350 options in the future should I need to. As far as the tutorial over at W3Schools.com has advised I need to use the following process: HTML Form - <Select> onclick run Javascript function Javascript function connects to server via PHP PHP runs query on the MySQL database and returns results Javascript then populates the 2nd drop down. and so on through to the final drop down. There are never more than 9 options in each drop down. Please can someone help me set this up. I have been using the code examples from W3Schools.com to put the following together. I use the alerts to check it's progress. It seems to be getting stuck when checking that the "if (xmlhttp.readystate==4)" line. Using Safari's built in Debug console the error I get back is that the php file cannot be found and there is a "500 Internal Server Error" - although I think (read as: assume) this is because the "if (xmlhttp.readystate==4)" isn't working. Any help would be much appreciated. Code: function selectMajor(str) { // an alert box to show that both a value has passed and it is the right type alert(SOC_Major.value); // enable the next drop down - SOC_SubMajor document.getElementById('SOC_SubMajor').disabled=false; // clear the next select box? document.Add_Vacancy.SOC_SubMajor.options.length=0 // POST to the php script // AJAX goes here if (str=="") { document.getElementById('SOC_SubMajor').innerHTML=" "; alert("str is empty"); return; } if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, opera, Safari xmlhttp=new XMLHttpRequest(); alert("new XMLHttpRequest created"); } else { // code for IE6, IE5 xmlhttp=new ActiveXObject('Microsoft.XMLHTTP'); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readystate==4) { alert("xmlhttp.readystate = 4"); if(xmlhttp.status==200) { alert("xmlhttp.status = 200") document.getElementById('SOC_SubMajor').innerHTML=xmlhttp.responseText; } else { alert("There was a problem while using XMLHTTP:\n"); } } } xmlhttp.open("POST","scripts/SOCSubMajorSelect.php?q="+str,true); xmlhttp.send(); } hi, i am trying to get some javascript working on a website i am making. the javascript changes the background image behind a photo. this simulates a user selecting a different frame from the drop down list http://jimpicot.com/shop/index.php?m...&products_id=3 below is the link to another forum it have been using to get most of the website working. http://www.zen-cart.com/forum/showthread.php?t=173765 Hi All, I am using a script that hides / shows a cell row depending on whether a form checkbox has been ticked. The HTML, CSS and JS code is below: CSS & HTML (simplified and normally in head / body tags etc.): Code: #lastRow { display: none;} <table> <tr> <td>Events Xtra:</td> <td><input class="text" type="Checkbox" name="upcoming" id="upcoming" value="checked"></em></td> </tr> <tr id="lastRow"> <td>Xtra Description:</td> <td><textarea name="event_description" cols="60" rows="5" id="event_description"></textarea></td> </tr> </table> JS: Code: function showHideRow(obj){ oLastRow.style.display = (obj.checked)? 'block' : 'none'; } window.onload=function(){ var oChkBox = document.getElementById('upcoming'); oLastRow = document.getElementById('lastRow'); oChkBox.onclick=function(){showHideRow(this);} showHideRow(oChkBox); } Now, the above works absolutely perfectly in Internet Explorer - when the checkbox is ticked, it displays the bottom row exactly as I want it to - i.e. as the next row in the table. However, in Chrome, Safari and Firefox it seems to display the whole row as a cell on it's own so distorting the entire table structure. I suspect it is something to do with the use of the id="lastRow", but I am not sure. The strange thing is that the HTML source is of course the same for both. Can anyone shed any light here? For convenience I have uploaded two images: IE (working fine): Firefox (distorting across page) Regards, Neil Hey everyone, I've got this slight problem with my code in javascript and I cant solve it to save my life and I don't really want to mess more things around incase it makes it worse. For some reason, when I click "get age" it just doesnt run, but the if statements seem to be running, any help would be appreciated Code: <script type = "text/javascript"> function dIM(Y, M) { with (new Date(Y, M, 1, 12)) { setDate(0); return getDate(); } } function dateDifference(birthdate1, birthdate2) { var year1 = birthdate1.getFullYear(), month1 = birthdate1.getMonth(), day1 = birthdate1.getDate(), year2 = birthdate2.getFullYear(), month2 = birthdate2.getMonth(), day2 = birthdate2.getDate(); if (day1 < day2){ month1--; day1 += dIM (year2, month2);day }; if (month1 < month2) { year1--; month1 += 12; } return [year1 - year2, month1 - month2, day1 - day2]; } function ageCalculator() { var day = document.age.inputdate.value; var month = (document.age.inputmonth.value - 1); var year = document.age.inputyear.value; var now = new Date(); thisday = now.getDate(); thismonth = now.getMonth(); thisyear = now.getFullYear(); var first = new Date(thisyear, thismonth - 1, thisday); var second = new Date(year, month - 1, day); var yourage; var datediff; if (day == "" || month == "" || year == "") { alert ("Please fill in all of the boxes before getting your age"); } else if ((day != parseInt(day)) || (month != parseInt(month)) || (year != parseInt(year))) { alert ("Please only enter digits in the day, month or year boxes"); return false; } datediff = dateDifference(first,second); if ((thismonth < month) || (thismonth == month & thisday<=day)) {thisyear--;} yourage = thisyear-year; var next = parseInt(year)+datediff[0]+1; var difference = Date.UTC(next, month, day, 0, 0, 0) - Date.UTC(thisyear, thismonth, thisday, 0, 0, 0); var daysleft = difference/1000/60/60/24; document.age.daysremaining.value = daysleft+" days left for your next birthday"; document.age.ageoutput.value = yourage; } function clear(form){ form.Result.value = ""; } </script> <center> <p> <form name = age> <p>Day of birth <input type="text" id="inputdate" size="2"><br/> Month of birth <input type="text" id="inputmonth" size="2"><br/> Year of birth <input type="text" id="inputyear" size="4" ><br/> <input name="button" type="button" id="button2" onClick="ageCalculator()" value = "Get Age"/> <input type="reset" name="Reset" id="button" value="Reset" /> </p> <p> You are <input type = "text" name = "ageoutput" size = "4" value = "0"> years old <input type = "text" name = "daysremaining" value = "0" /> </p> </form> I am very new to coding, I am currently working on this design as my very first: http://img822.imageshack.us/img822/6533/unled1pd.jpg. I am currently working on the Image slider which is on the left side next to the login bar and headlines. I don't know where to start with this. If someone could walk me through or help me in anyway i would greatly appreciate it. Here is my current project LIVE: http://visionarycreativegrp.com/Demos/ForSale%20RED/# Hi, I am working on simple project and it's for the institute Class project where i am learning php. i have to submit the project as soon as possible. But i am doing it different way then of i was supposed. Instead of validation message i want to use a picture or icon with Red error icon and Green yes icon as you can check in the attached picture. I am calling a function on submit button and if there is any error then using document.GetElementById('error').style.background="none" and ="pic url". I am getting output but it's just for a second then disappeared. I have already attached the Screen Shot to get the full idea.. Mainly i want to display red icon on error and green one when there is not error. Hey guys, I'm new to javascript and I'm trying to get this code to work. It's a pretty basic system to start with, just wanting to calculate the total pay for employees and using the array so that I can key multiple employees at a time. Can anyone help me adjust my code so that this system works? Thanks for your help in advance, it's greatly appreciated. Code: var NoEmps var PayRate= new Array(); var HrsWorked= new Array(); var EmpName= new Array(); var GrossPay= new Array(); var i var j NoEmps=prompt("Enter Number of Employees to process","") i = 0; while (i<NoEmps) { EmpName[i]= prompt("Enter employee name","") PayRate[i]=prompt("Enter employee pay rate","") HrsWorked[i]= prompt ("Enter hours worked","") if ((isNaN(PayRate[i]))||(isNaN(HrsWorked[i]))) { alert("Please enter numbers") flag = "false" break } if PayRate[i]>25 { alert ("Pay rate can only b $25 or less per hour") flag == "false" break } //i = i +1 } if (flag = "true") { for (j in EmpName) { GrossPay[j]=PayRate[j] * HrsWorked[j] } for (counter; counter<EmpName.length; counter++) { document.write ("Gross Pay for " + EmpName[counter] + " is $" + GrossPay[counter] + "<br>") } } |