DeeDee2010 Posted March 6, 2009 Share Posted March 6, 2009 As you helped me creating my script to upload automatically new transaction number, I once again ask for help with a code snippet. Here is the code. <script language="JavaScript">function PasswordLogin() { document.location.href = document.formlogin.trackingnr.value + ".html"; return false; } function CheckEnter(event) { var NS4 = (document.layers) ? true : false; var code = 0; if (NS4) code = event.which; else code = event.keyCode; if (code==13) { PasswordLogin(); event.returnValue = false; } }</script> It works well, but I don't know what to modify in order to search the document in another folder. For example, now it only searches the document entered only in the folder where the script (which is in a html page), and I would like it to look for the document in a folder let's say "transactions" which is down one level, or up one level. What should I modify? Can you help please? Thanks Quote Link to comment Share on other sites More sharing options...
DeeDee2010 Posted March 6, 2009 Author Share Posted March 6, 2009 Sorry, I posted the wrong code Here is it, complete with the form: <script type="text/javascript"> function PasswordLogin() { var filename = document.formlogin.trackingnr.value.toUpperCase() + ".html"; var http = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject('MSXML2.XMLHTTP.3.0'); if (!http) { window.location = filename; return false; } http.open('GET', filename, true); http.onreadystatechange = function() { if (http.readyState == 4) { if (http.status == 200) { window.location = filename; } else { alert('Votre Numero est errone. Merci de reessayer!'); return false; } } } http.send(null); return false; } </script> Any Ideas on how to change the search location? Here is the form: <form action="" method="get" name="formlogin" onSubmit="return PasswordLogin();"> Numero de Depistage: <p> <input name="trackingnr" id="trackingnr" size="14" type="text" class="style112" onBlur="this.value = this.value || this.defaultValue; this.style.color = '#999';" onFocus="this.value=''; this.style.color = '#000';"> <br> <input name="button" value="Suivi!" type="submit" style="background: #FF6600; color: white; font: 8pt bold Verdana, Arial, Helvetica, sans-serif"> Quote Link to comment Share on other sites More sharing options...
DeeDee2010 Posted March 6, 2009 Author Share Posted March 6, 2009 nobody? Quote Link to comment Share on other sites More sharing options...
corbin Posted March 7, 2009 Share Posted March 7, 2009 var filename = document.formlogin.trackingnr.value.toUpperCase() + ".html"; Is what you want to modify, I think. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.