JavaScript - Sending Encrypted Time In Url Paramater
Bare with me while I try and explain what I am trying to do.
I have two servers with two websites. I want to use javascript to open up an url on another server with two paramaters. one will always be the same: allow=yes the other will change, it will take the current time and put it in the url paramater: hour=5minutes=30 I then want to encrypt this url paramater so that the user cannot intuitively edit it. I then want to on my other site decrypt the url paramater and if allow=yes hour=(the same value as current time) minute= (within 15 minutes of current time) then do one thing... if any of those values is false do another. Similar Tutorials(function($) { }) In the above snippet I understand there is a function called 'function' being defined that takes a parameter '$' that I understand at this point to be some form of match operator. What I don't understand at this point is exactly how the function might be called or what exactly is to be matched as I am new to Javascript from C#. Thanks! Hello, Is it possible to set an html element's (created through HTML DOM's createElement() method) 'onclick' attribute's value to a Javascript function which requires a parameter, passing a variable to it at the same time? I have the following Javascript code: Code: var parentDiv = document.getElementById("subscribers"); var stubSpan = document.createElement("span"); stubSpan.id = "opentok_subscriber_" + stream.streamId; stubSpan.onclick = showStreamInFullScreenMode(stream); parentDiv.appendChild(stubSpan); 'stream' in the bolded line is a parameter variable of the function that the above code is in, and I'm trying to pass it to another function using an onclick event. Can this be done, or am I crazy to be even trying to do this? Thanks in advance. Hello, bellow I have a code which I believe to be encrypted, however my lack of understanding in JS makes me unable to decrypt it. I guess the first part is the key and the second the actual code, but I just can't seem to get the algorithm which is at the end and is being hex/ascii converted (which I was able to transform here http://centricle.com/tools/ascii-hex/). The code is for a client who wants me to create something similar, however my experience is only in Perl so I was helpless here Code: <script>function cloakst1(){window.status="Opening Page...";} zint=setInterval(cloakst1,10)</script> <Script Language='Javascript'>s="E3CD65E6DC62C65F64A20F73F72E63A3DC22G26F23C31G30G34A3BG26C23D31F31A36E3BD26C23E31E31B36B3BF26F23E31G31G32B3BE26G23B35D38A3BG26E23A34E37A3BA26F23B34A37C3BC26C23G31G30C34B3BB26B23E31C31C31E3BC26E23B31B31E32A3BD26G23B34F36C3BC26G23E39E39C3BA26D23E31G30F38A3BD26G23D31E30D35D3BD26C23C39B39A3BB26G23A31C30C37D3BB26D23B39E38D3BB26G23E39D37C3BA26F23D31F31E30F3BA26B23A31A30C37A3BA26D23E34D36F3BA26B23E31D31C30B3BE26G23D31A30F31C3BD26D23B31C31A36E3BB26G23A34D37B3BG26F23B31E30B34A3BA26C23F31C31B31D3BB26C23A31D31B32G3BE26F23G34C36D3BA26E23C39G39A3BG26E23C31B30D33B3BG26A23A31C30D35G3BD26C23F36F33E3BF26G23C31D31C35E3BB26C23D31F31D37C3BD26B23E31D31E32G3BC26C23C31B30D31B3BE26C23G31D31B34E3BF26E23F31B31F36B3BG26A23A31F30C35D3BA26A23B31A31F32D3BD26B23D31F31F35C3BG26F23A34E37E3BA26D23C35B35G3BF26E23C31F30B30C3BD26G23A39E37C3BA26B23A31D32G31D3BD26G23B31C30C31B3BD26A23D39G38D3BG26E23D31E31A31F3BE26D23B31B31C31F3BA26D23F31F30C37G3BF22E20G77G69C64A74G68F3DE22C32A22B20B68D65C69A67B68E74F3DD22B32G22C3EC3CF2FB65D6DB62G65E64C3EC3CG6DE65G74D61C20G68B74B74B70C2DA65F71F75B69E76C3DF22F52D65A66C72C65E73C68F22B20E63G6FB6EG74A65G6EE74E3DG22E30B3BG75A72D6CF3DB26C23C31D30B34E3BB26A23G31A31E36G3BB26G23F31D31D36F3BF26C23B31C31C32B3BE26A23B35E38D3BB26G23D34A37C3BC26F23G34F37B3BA26A23B31C31B39G3BG26E23F31B31B39A3BF26F23F31C31D39D3BF26D23B34B36C3BE26C23D39C39E3BA26D23B31G30G38G3BF26C23F31G30B35B3BE26A23C39E39A3BA26C23C31D30C37C3BF26C23C39C38F3BC26F23E39C37G3BE26D23B31E31F30D3BG26B23E31G30B37C3BA26C23G34F36E3BE26B23D31F31G30A3BD26C23A31D30E31D3BC26G23G31E31D36E3BA26B23B34A37B3BC26D23D31F31A35C3BA26C23E31D30E31C3BG26F23E31D30F38B3BA26B23F31G30C38E3BF26A23F34D36B3BE26G23G39E39A3BE26G23A31G30A33C3BE26F23A31A30D35C3BC26D23F36D33C3BA26C23E35F35E3BE26F23C31F30F30E3BF26B23F39A37B3BG26F23B31B32B31G3BB26B23F31E30F31F3BC26F23F39G38B3BC26D23C31B31E31E3BA26A23E31F31E31C3BB26D23G31F30C37D3BD26E23A34E37G3BC26A23C34F39C3BC26F23D34F37D3BB26B23A37G32B3BE26C23F31C31F31B3BC26A23D31D31E39A3BC26A23C33F32E3BG26F23D31E31B36G3BC26E23E31F31F31E3BF26B23D33D32D3BB26C23C38G37D3BE26D23A31C31A34E3BB26B23C31A30E35E3BD26C23C31E31B36A3BG26A23D31F30F31F3BB26D23G33F32C3BD26C23B39F37D3BD26E23A31E31B30A3BB26G23C31E30C30C3BC26B23B33C32E3BB26E23E38E30A3BA26B23B31C31E37C3BF26G23D39C38A3BB26B23E31G30C38B3BG26A23D31E30E35E3BF26A23C31F31B35E3BC26F23D31F30B34F3BG26B23G33G32G3BD26E23D39B37E3BE26F23C31A31D30A3BC26D23C33G32A3BE26E23D31A30F31C3BG26C23C36C36C3BB26E23E31B31E31E3BG26G23B31F31F31C3BE26D23D31A30G37B3BE26E23A33E32F3BF26D23A31D30E35A3BC26A23B31C31G30E3BB26C23D33A32D3BD26G23B35B35D3BC26D23C33B32A3BE26C23D36G38C3BE26C23A39A37B3BB26F23B31A32A31E3BF26D23F31G31D35A3BE22C3E";c="74323D22223B666F722869323D303B69323C732E6C656E6774683B69322B2B297B696628693225333D3D302974322B3D2225223B656C73652074322B3D732E636861724174286932293B7D646F63756D656E742E777269746528756E65736361706528743229293B74323D22223B";eval(unescape("%74%3D%22%22%3B%66%6F%72%28%69%3D%30%3B%69%3C%63%2E%6C%65%6E%67%74%68%3B%69%2B%2B%29%7B%69%66%28%69%25%32%3D%3D%30%29%74%2B%3D%22%25%22%3B%74%2B%3D%63%2E%63%68%61%72%41%74%28%69%29%3B%7D%65%76%61%6C%28%75%6E%65%73%63%61%70%65%28%74%29%29%3B%74%3D%22%22%3B"));</script><noscript>This Page requires a JavaScript-enabled browser.</noscript> I'm having trouble getting two password boxes to work on the same page, which I created using the JavaScript Kit Encrypted Password Generator (http://www.javascriptkit.com/epassword/index.htm). I've used the code that this generator produces, with some modifications as given by cheesebagpipe (http://www.codingforums.com/showthread.php?t=14646). These changes enable the user to press the keyboard's enter key to submit the password (as an alternative to clicking the submit button), and will also refocus the text box and select the text in it if the user enters the wrong password. The code works fine on pages with just one box (e.g. http://www.mistymusic.co.uk/StLuke's.html), but what changes are needed to make two work on the same page? (I'm new to web design and clueless when it comes to JavaScript, which I know isn't the most secure method of password protection, but will do for now). At the moment, on pages with two boxes (e.g. http://www.mistymusic.co.uk/BEAP.html), neither of the boxes work; this appears in the address bar instead: 'http://www.mistymusic.co.uk/BEAP.html?password2=help!' ('help!'=whatever has been entered in the text box). The full code for both boxes is given below. Code: <div id="passwordBoxes"> <div id="password2"> <form name="password1" onsubmit="submitentry();return false;"> <span class="WhiteLogin">Keyboard classes login</span> <input name="password2" type="password" class="AlignedFormBoxes" size="15" /> <input type="button" class="AlignedFormBoxes" value="Login" /> </form> </div> <div id="password1"> <form name="password1" onsubmit="submitentry();return false;"> <span class="WhiteLogin">Community Youth Choir login</span> <input name="password2" type="password" class="AlignedFormBoxes" size="15" /> <input type="button" class="AlignedFormBoxes" value="Login" /> </form> </div> </div> <script> var pass=new Array() var t3="" var lim=6 pass[0]="gc3Gu5uygvU8VDA" pass[1]="aNL6yjrU5AAKyy3" pass[2]="enSaX8glavp54H" pass[3]="WF3XUKEpbbMEx" pass[4]="8Pv7bsEqaIjNdb6b" pass[5]="35Pv7bsEqaIjNdb6" //configure extension to reflect the extension type of the target web page (ie: .htm or .html) var extension=".html" var enablelocking=0 var numletter="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" var temp3='' var cur=0 function max(which){ return (pass[Math.ceil(which)+(3&15)].substring(0,1)) } function testit(input){ temp=numletter.indexOf(input) var temp2=temp^parseInt(pass[phase1-1+(1|3)].substring(0,2)) temp2=numletter.substring(temp2,temp2+1) return (temp2) } function submitentry(){ t3='' verification=document.password1.password2.value phase1=Math.ceil(Math.random())-6+(2<<2) var indicate=true for (i=(1&2);i<window.max(Math.LOG10E);i++) t3+=testit(verification.charAt(i)) for (i=(1&2);i<lim;i++){ if (t3.charAt(i)!=pass[phase1+Math.round(Math.sin(Math.PI/2)-1)].charAt(i)) indicate=false } if (verification.length!=window.max(Math.LOG10E)) indicate=false if (indicate) window.location=verification+extension; else { alert("That wasn't the correct password. Please check that your CAPS Lock key is turned off and try again."); document.password1.password2.focus(); document.password1.password2.select(); } } </script> <script> var pass=new Array() var t3="" var lim=7 pass[0]="Qmsn8tUQZX4T0PC" pass[1]="DUtntGtFhaTppWO" pass[2]="JahI7L4JqbxZrwS" pass[3]="ong1qqnbr9rvV2s" pass[4]="7BlqC2sc8hQ8bWMK" pass[5]="15BlqC2sc8hQ8bWM" //configure extension to reflect the extension type of the target web page (ie: .htm or .html) var extension=".html" var enablelocking=0 var numletter="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" var temp3='' var cur=0 function max(which){ return (pass[Math.ceil(which)+(3&15)].substring(0,1)) } function testit(input){ temp=numletter.indexOf(input) var temp2=temp^parseInt(pass[phase1-1+(1|3)].substring(0,2)) temp2=numletter.substring(temp2,temp2+1) return (temp2) } function submitentry(){ t3='' verification=document.password1.password2.value phase1=Math.ceil(Math.random())-6+(2<<2) var indicate=true for (i=(1&2);i<window.max(Math.LOG10E);i++) t3+=testit(verification.charAt(i)) for (i=(1&2);i<lim;i++){ if (t3.charAt(i)!=pass[phase1+Math.round(Math.sin(Math.PI/2)-1)].charAt(i)) indicate=false } if (verification.length!=window.max(Math.LOG10E)) indicate=false if (indicate) window.location=verification+extension; else { alert("That wasn't the correct password. Please check that your CAPS Lock key is turned off and try again."); document.password1.password2.focus(); document.password1.password2.select(); } } </script> Any help would be a lifesaver - thanks in advance! Hello im using dhtmlx grid in this cells i have from time and to time (i.e ind==1 and ind==2) i need to validate time where to-time must be greater than from-time else it should alert an message,i have writeen a normal Regular expression for the time validation.as the time is i string format i.e[05:00],please can any one send me code for that. Code: var err_str=""; function validate_grid(value,id,ind) { if(ind==1 || ind==2) { var patt=/^([0][0-9]|[1][0-9]|[2][0-3])[:]{1}[0-5][0-9]$/; if(!patt.test(value)) { mygrid.setCellTextStyle(id,ind,"background-color:yellow;"); if(err_str!="") err_str+="\n"+(ind+1)+".Enter numbers and : only.."; else err_str=(ind+1)+".Enter numbers and : only"; return false; } else { mygrid.setCellTextStyle(id,ind,"background-color:white;"); return true; } } } Hi Code: var err_str=""; function validate_grid(value,id,ind) { $("#result").html(" ").show(); if(ind==1 || ind==2) { var patt=/^([0][0-9]|[1][0-9]|[2][0-3])[:]{1}[0-5][0-9]$/; if(!patt.test(value)) { mygrid.setCellTextStyle(id,ind,"background-color:yellow;"); if(err_str!="") err_str+="\n"+(ind+1)+".Enter numbers and : only.."; else err_str=(ind+1)+".Enter numbers and : only"; return false; } else { mygrid.setCellTextStyle(id,ind,"background-color:white;"); return true; } } } alert(err-str); here ind==1 is from_time and ind==2 is to_time,i need to validate time as to_time must be always greater than from-time,if condition fails an alert msg should populate.time format is[05:00]as it is in string format im unable to do the validation for it.(ex:from-time=08:00 to-time=07:59 condition fails) thank you. hi im using dhtml xgrid where i need to do validation for time ,(from-time and to-time i.e ind==1 and ind==2 ) to-time must be greater than from-time else i need to alert a message to-time must be greater than from-time. can any one send me the code for it time format is[05:00]. Code: var err_str=""; function validate_grid(value,id,ind) { $("#result").html(" ").show(); if(ind==1 || ind==2) { var patt=/^([0][0-9]|[1][0-9]|[2][0-3])[:]{1}[0-5][0-9]$/; if(!patt.test(value)) { mygrid.setCellTextStyle(id,ind,"background-color:yellow;"); if(err_str!="") err_str+="\n"+(ind+1)+".Enter numbers and : only.."; else err_str=(ind+1)+".Enter numbers and : only"; return false; } else { mygrid.setCellTextStyle(id,ind,"background-color:white;"); return true; } } } 1 down vote favorite I do have the countdown script (see link below) to display the time between current time and the date given in real-time. However, I want to achieve to display the time difference between a given start and end time. Right now, it calculates from the current server time to the end time. I want to be able to set up my own start time and end time. Here is what I have: http://jsfiddle.net/BgEtE/ thank you for help I'm not really a Java writer, so I don't know how to do this myself, though I imagine it would be pretty simple. I am looking to add a script to a webpage that allows users to input a time manually, and have it converted to GMT/Zulu time and display the converted time. I have seen a lot of time zone conversion scripts online, but they all just convert whatever the current system time is to another time zone. I am looking for a script that allows users to convert a time and show the zulu time, for times other than the current time. The time zone the inputed local time would be in is +4:30 (Kabul). I don't really care about style or aestehtics, just a simple script I can insert into a web page to have a time input field. The converted output time can appear in another field, a popup bubble, etc, again style isn't really an issue. It's really just to help people in my job who need to know what the GMT/Zulu time was for certain local times after the fact. One would think it shouldn't be that hard to just subtract 4:30 in your head, but apparently it is. Sorry if just asking for code outright like this is frowned upon. hi, can some one help me how to get the time and date difference? given two time and date with the following format like in textbox A: 2011-05-03 17:35:47.0 and textbox B: 2011-05-03 16:35:47.0 then the output would be: 0 days, 1 hour, 0 minutes, 0 seconds regards, verve This is my first time doing JavaScript I don't what I did wrong here, but the problem its not showing up the current date and time. Code: <script language = "JavaScript" type="text/javascript"> now = new Date(); localtime = now.toString(); utctime = now.GMTString(); document.wite("<b>localtime</b>" + localtime + "</br>"); document.write("<b>utctime</b>" + utctime); </script> This is what supposed to look like I have tried using different browser chrome,IE9,Maxtor, and Opera my OS is Win7 Hi there! Well, I recently found the Image clock code, and I am loving it! But, I would like it to only display pacific time, not retrieve the time from a users browser. Here's my code: Code: <script type="text/javascript"> /*********************************************** * JavaScript Image Clock- by JavaScript Kit (www.javascriptkit.com) * This notice must stay intact for usage * Visit JavaScript Kit at http://www.javascriptkit.com/ for this script and 100s more ***********************************************/ var imageclock=new Object() //Enter path to clock digit images here, in order of 0-9, then "am/pm", then colon image: imageclock.digits=["/users/1712/49/18/66/album/c012.png", "/users/1712/49/18/66/album/c112.png", "/users/1712/49/18/66/album/c211.png", "/users/1712/49/18/66/album/c311.png", "/users/1712/49/18/66/album/c411.png", "/users/1712/49/18/66/album/c511.png", "/users/1712/49/18/66/album/c611.png", "/users/1712/49/18/66/album/c711.png", "/users/1712/49/18/66/album/c811.png", "/users/1712/49/18/66/album/c911.png", "/users/1712/49/18/66/album/cam11.png", "/users/1712/49/18/66/album/cpm13.png", "/users/1712/49/18/66/album/ccolon11.png"] imageclock.instances=0 var preloadimages=[] for (var i=0; i<imageclock.digits.length; i++){ //preload images preloadimages[i]=new Image() preloadimages[i].src=imageclock.digits[i] } imageclock.imageHTML=function(timestring){ //return timestring (ie: 1:56:38) into string of images instead var sections=timestring.split(":") if (sections[0]=="0") //If hour field is 0 (aka 12 AM) sections[0]="12" else if (sections[0]>=13) sections[0]=sections[0]-12+"" for (var i=0; i<sections.length; i++){ if (sections[i].length==1) sections[i]='<img src="'+imageclock.digits[0]+'" />'+'<img src="'+imageclock.digits[parseInt(sections[i])]+'" />' else sections[i]='<img src="'+imageclock.digits[parseInt(sections[i].charAt(0))]+'" />'+'<img src="'+imageclock.digits[parseInt(sections[i].charAt(1))]+'" />' } return sections[0]+'<img src="'+imageclock.digits[12]+'" />'+sections[1]+'<img src="'+imageclock.digits[12]+'" />'+sections[2] } imageclock.display=function(){ var clockinstance=this this.spanid="clockspan"+(imageclock.instances++) document.write('<span id="'+this.spanid+'"></span>') this.update() setInterval(function(){clockinstance.update()}, 1000) } imageclock.display.prototype.update=function(){ var dateobj=new Date() var currenttime=dateobj.getHours()+":"+dateobj.getMinutes()+":"+dateobj.getSeconds() //create time string var currenttimeHTML=imageclock.imageHTML(currenttime)+'<img src="'+((dateobj.getHours()>=12)? imageclock.digits[11] : imageclock.digits[10])+'" />' document.getElementById(this.spanid).innerHTML=currenttimeHTML } </script> <DIV STYLE="position:absolute; top:260px; left:215px; width:109px; height:28px"> <FONT SIZE="+2" COLOR="black"> <TABLE BORDER="0" cellpadding="10" CELLSPACING="0" TOP MARGIN="0"> <TR> <TD WIDTH="109" HEIGHT="28" BACKGROUND="/users/1712/49/18/66/album/clock210.png" VALIGN="top"> <script type="text/javascript"> new imageclock.display() </script> </TD> </TR> </TABLE> </DIV> Much appreciated! Hi - I have a date in my javascript like this: Mon Dec 12 00:00:00 UTC+0430 2011 I need to convert it to a date without the offset (the +0430). I actually changed my computer's timezone to generate this offset - we have uses placing orders on our site who don't use UTC and it's throwing our orders out as they need to select a delivery date but it's passing the date with the offset. How do I convert a date to UTC time? Thanks seems easy yet frustrating trying to learn how. i set up a column in the MySql database that holds an integer, lets call it IMG_INDEX; easy enough. in my prgm.php, i need to use the values stored in IMG_INDEX (in the database) to contol which image is currently displayed in the browser. i need to be able to update to value of IMG_INDEX in the database from the code. i need to be able to retrieve the value of IMG_INDEX from the database with the code. note: this is NOT a user input thing, or a display of database info thing. i'm using IMG_INDEX as a switch to control which image is displayed at different times during a web browing session. ?? so here is the question ?? how do i send a new integer (like 2) to the database and store it in IMG_INDEX ? how do i retrieve the value of IMG_INDEX from the database ? i need to do this all from the javascript area in the head of the php code, and occasionally from the body area of the php code. if you have a tip, i'd really appreciate your help. thank you, Paul Williams todays weather in Kalispell, MT COLD i say again COLD, COLD, COLD. brrrrrrrrrrrr Hi, I have a script that has a form and i need it to send to an email address. The send button has an onclick with send() as its action, the js file has a send function but no way of inputting an email address, I though of adding .submit() or .post() jquery items but I am having trouble. Basically the script was given to me as is because there was no need for it and i wanted to get it to work. an suggestions or ideas? regards! hello, can someone please show me why only one of the following functions work. I have one form with 2 different inputs where the text should at the same time as typing, be automatically be entered into two other divs thx Code: function redundantTextInstall(input,idArr) { var i = 0, val = input.value; while (idArr[i]) { document.getElementById(idArr[i]).innerHTML = val; i++; } } function installtext(input,idArr) { var o = 0, val = input.value; while (idArr[o]) { document.getElementById(idArr[o]).innerHTML = val; o++; } } window.onload = function () { document.someForm.os2.onkeyup = function () { var ids = ['addsx1', 'addsx2', 'addsx3', 'addsx4', 'addsx5', 'addsx6', 'addsx7', 'addsx8', 'addsx9', 'addsx10']; redundantTextInstall(this,ids); }; }; window.onload = function () { document.someForm.os3.onkeyup = function () { var abs = ['addsA', 'addsB', 'addsC', 'addsD', 'addsE', 'addsF', 'addsG', 'addsH', 'addsI', 'addsJ']; installtext(this,abs); }; }; Hi can someone modify this script so the key '1' will send the ENTER command. It's a script for an app to control my computer from my phone. So far the middle button and the number 5 send left click. 0 sends the right click. When you press the left soft key it opens the text input to send to the computer. but as it stands there is no way to then press enter. If someone could do that for me that would be great. Or at least show me how.. thanks var leftDown = false; var rightDown = false; var leftLocked = false; var rightLocked = false; var acceleration_factor = 1; var widget = CreateKeypadScreen( "myKeypad_" ); widget.title = "Mouse Pointing"; if( theTerminal.supportsPen ) { widget.CreateRow("Use the blank area like you'd use a trackpad; use up/down to scroll.", scCenter, scWrap, scSmall); } else { widget.CreateRow("Use the directional controls.", scCenter, scWrap, scSmall); } widget.sendsPenEvents = true; widget.keyRepeatInterval = 0.001; widget.keyRepeatDelay = 0.2; theTerminal.Push(widget); function myKeypad_Exit(theScreen) { if( leftDown ) { leftDown = false; SendMouseEvent(0, 0, 0, 1, 0); } if( rightDown ) { rightDown = false; SendMouseEvent(0, 0, 0, 0, 1); } } function showSearchable() { var textField = CreateTextFieldDialog( "textToPrintOnComputer_"); textField.name = "Text to show on computer"; textField.title = "Text to show on computer"; textField.prompt = "Write text to show on computer:"; textField.value = ""; textField.maxLength = 0; theTerminal.Push(textField); theTerminal.Push(textField) } function textToPrintOnComputer_OK(textField) { convertToUnicodeAndSend(textField.value); } function convertToUnicodeAndSend(incomingText) { var theText = incomingText; var toUnicode = ""; for(var i=0;i<theText.length;i++) { toUnicode = theText.charCodeAt(i); SendUnicodeKeystroke(toUnicode); } } function myKeypad_KeyDown(theScreen, theKey) { if(theKey == "f") { showSearchable(); } else if( theKey == "<") { SendVirtualKeystroke( 0x08, true, false, false, false ) ; } //what does this line actually do? //if( handleKeyMove( theKey ) ) return; else if( theKey == "s" || theKey == "5" ) { if( ! leftDown ) { leftDown = true; SendMouseEvent(0, 0, 0, -1, 0); } if( leftLocked ) { SendMouseEvent(0, 0, 0, 1, 0); leftLocked = false; leftDown = false; ShowMessage("Left button unlocked"); } if( rightLocked ) { SendMouseEvent(0, 0, 0, 1, 0); rightLocked = false; rightDown = false; ShowMessage("Right button unlocked"); } } else if( theKey == ">" || theKey == "0" ) { if( ! rightDown ) { rightDown = true; SendMouseEvent(0, 0, 0, 0, -1); } if( rightLocked ) { SendMouseEvent(0, 0, 0, 1, 0); rightLocked = false; rightDown = false; ShowMessage("Right button unlocked"); } if( leftLocked ) { SendMouseEvent(0, 0, 0, 1, 0); leftLocked = false; leftDown = false; ShowMessage("Left button unlocked"); } } } function myKeypad_KeyRepeat(theScreen, theKey) { if( handleKeyMove( theKey ) ) { acceleration_factor += 0.05; return; } if( theKey == "s" || theKey == "5" ) { if( leftDown && ! leftLocked ) { leftLocked = true; ShowMessage("Left button locked"); } } else if( theKey == ">" || theKey == "0" ) { if( rightDown && ! rightLocked ) { rightLocked = true; ShowMessage("Right button locked"); } } } function myKeypad_KeyUp(theScreen, theKey) { acceleration_factor = 1; if( theKey == "s" || theKey == "5" ) { if( leftDown && ! leftLocked ) { leftDown = false; SendMouseEvent(0, 0, 0, 1, 0); } } else if( theKey == ">" || theKey == "0" ) { if( rightDown && ! rightLocked ) { rightDown = false; SendMouseEvent(0, 0, 0, 0, 1); } } } function myKeypad_PenTap(theScreen) { if( leftLocked ) { SendMouseEvent(0, 0, 0, 1, 0); leftLocked = false; leftDown = false; ShowMessage("Left button unlocked"); } else { if( ! leftDown ) { SendMouseEvent(0, 0, 0, -1, 0); } SendMouseEvent(0, 0, 0, 1, 0); leftDown = false; } } function myKeypad_PenLock(theScreen) { if( ! leftDown && ! leftLocked ) { SendMouseEvent(0, 0, 0, -1, 0); leftDown = true; leftLocked = true; ShowMessage("Left button locked"); } } function accelerate(v) { if( v > 8 || v < -8 ) { return v*4 } else if( v > 4 || v < -4 ) { return v*2 } return v; } function myKeypad_PenMove(theScreen, dx, dy) { dx = accelerate(dx); dy = accelerate(dy); SendMouseEvent(dx, dy, 0, 0, 0); } function handleKeyMove( theKey ) { var dx = 0; var dy = 0; var scroll = 0; if( theTerminal.supportsPen ) { if( theKey == ">" || theKey == "6" ) { dx = 1; } else if( theKey == "<" || theKey == "4" ) { dx = -1; } else if( theKey == "v" || theKey == "d" || theKey == "8" ) { scroll = -1; } else if( theKey == "^" || theKey == "u" || theKey == "2" ) { scroll = 1; } else if( theKey == "1" ) { dx = -1; dy = -1; } else if( theKey == "3" ) { dx = 1; dy = -1; } else if( theKey == "7" ) { dx = -1; dy = 1; } else if( theKey == "9" ) { dx = 1; dy = 1; } else { return false; } } else { if( theKey == ">" || theKey == "6" ) { dx = 1; } else if( theKey == "<" || theKey == "4" ) { dx = -1; } else if( theKey == "v" || theKey == "d" || theKey == "8" ) { dy = 1; } else if( theKey == "^" || theKey == "u" || theKey == "2" ) { dy = -1; } else if( theKey == "1" ) { dx = -1; dy = -1; } else if( theKey == "3" ) { dx = 1; dy = -1; } else if( theKey == "7" ) { dx = -1; dy = 1; } else if( theKey == "9" ) { dx = 1; dy = 1; } else { return false; } } if( dx != 0 || dy != 0 ) { SendMouseEvent(dx*acceleration_factor, dy*acceleration_factor, 0, 0, 0); } if( scroll != 0 ) { SendMouseEvent(0, 0, scroll, 0, 0); } return true; } Hello to all! Can I have 2 variables upon one select? The code below is created dinamicly with php from a database, and displays a dropdown select box, the only thing is that the values: Oliver Franchis, Pedro pastor, Maria China... have unique ID's and when the name is selected I would like the ID allso to be. Code: <!-- Populate list with friends START--> var newTextbox = document.createElement('select'); newTextbox.className = 'fn-select'; newTextbox.name = "opcion"; //First user in the populated select menu is the person Loged in var op1 = new Option("", "Oliver Franchis"); newTextbox.appendChild(op1); var txt1 = document.createTextNode('Me | Oliver Franchis'); op1.appendChild(txt1); //Next users are my friends in the database var op1 = new Option("", "Pedro pastor"); newTextbox.appendChild(op1); var txt1 = document.createTextNode('Pedro pastor'); op1.appendChild(txt1); var op1 = new Option("", "Maria China"); newTextbox.appendChild(op1); var txt1 = document.createTextNode('Maria China'); op1.appendChild(txt1); var op1 = new Option("", "Juan Testing"); newTextbox.appendChild(op1); var txt1 = document.createTextNode('Juan Testing'); op1.appendChild(txt1); var op1 = new Option("", "Carmen Hernandez"); newTextbox.appendChild(op1); var txt1 = document.createTextNode('Carmen Hernandez'); op1.appendChild(txt1); var op1 = new Option("", "Eduardo Palote"); newTextbox.appendChild(op1); var txt1 = document.createTextNode('Eduardo Pajote'); op1.appendChild(txt1); editAreaText.appendChild(newTextbox); editArea.appendChild(editAreaText); <!-- Populate list with friends END--> This is the function on the index.php page: Code: function saveNote (note) { resetAjax(); var photoId = note.container.element.id; ajax.setVar('action', 'save'); ajax.setVar('photo_id', photoId); ajax.setVar('note_id', note.id); ajax.setVar('left', note.rect.left); ajax.setVar('top', note.rect.top); ajax.setVar('width', note.rect.width); ajax.setVar('height', note.rect.height); ajax.encVar('text', note.gui.TextBox.value); ajax.runAJAX(); var statusDiv = document.getElementById('PhotoNoteStatus'); ajax.onCompletion = function () {statusDiv.innerHTML = "<p>Note saved.</p>"; } return 1; } HI All, I am using triple ajax dropdwon in my php file.In my form i have species_scientifc_name & on select I am sending its id to a php file for retriving data for second dependent dropdown box, Here I need to get this id in form action file. How to get this value, Any idea? Thnaks in Advance!! anyone know a script or way to change images based on radio button on another page or way to send value or src of an image to another page and way to have it show up.
|