JavaScript - Chage Textbox Type Fron Text To Password
I was just wondering how I could change a html text input tpe from text to password on the on click and when the user clicks off it will change back to text just like facebook does.
Similar TutorialsBasically what I am looking for is a script that when you click a button, it changes the text in a text box to asterisks, AND also submits the information to the server, so it can be saved. Even if it does not send info to the server, if it can switch it, That would be good too. Can anyone help me with this script? I am sure that lots of people have seen the Credit Card commercial on T.V. with Emmitt Smith and him putting in his password of "Catch-22" then clicking on a button, and the password automatically changes to asterisks (********) in the textbox. How is this done? Is it js, ssl or what? If it is a ssl, can someone tell me what kind it would be? I would like to have something like that for a website of mine, where the user can create his password, and see it before he/she confirms it as the password by clicking on the "confirm" button. I dont like having to enter my password twice to verify it, so I think that this would do the job better for me. Thanks, ImperialSpider I need to change input type="text" to input type="password" via JavaScript Code: <form id="login" action="#" method="post"> <input id="username-field" type="text" name="username" title="Username" onmousedown="javascript:this.value=''; javascript:this.focus();" value="Username" tabindex="1" /> <input id="password-field" type="text" name="password" title="Password" onmousedown="javascript:this.value=''; javascript:this.type='password'; javascript:this.focus();" value="Password" tabindex="2" /> <input type="submit" name="submit" value="sign in" tabindex="3" /> </form> This works in Firefox and Safari but not IE So then I tried this code Code: <script type="text/javascript"> function passit(ip){ var np=ip.cloneNode(true); np.type='password'; if(np.value!=ip.value) np.value=ip.value; ip.parentNode.replaceChild(np,ip); } </script> <form id="login" action="#" method="post"> <input id="username-field" type="text" name="username" title="Username" onmousedown="javascript:this.value=''; javascript:this.focus();" value="Username" tabindex="1" /> <input id="password-field" type="text" name="password" title="Password" onmousedown="javascript:this.value=''; passit(this.form[0]); javascript:this.focus();" value="Password" tabindex="2" /> <input type="submit" name="submit" value="sign in" tabindex="3" /> </form> This does what I need but turns the username type to password field not the password box Please can somone help! how would you make a function that cheks if any text is in a text box.
I've got this code, and nothing happens when I click the button! Please help. <!DOCTYPE HTML> <html> <head> <title> Author Identifier </title> </head> <body> <form action="w3schools.com" id="theForm"> <textarea name="input1" id="input1" rows=8 cols=80>Enter a passage from an author of your choice.</textarea> <br> <textarea name="input2" id="input2" rows=8 cols=80>Enter another passage from an author of your choice.</textarea> <br> <textarea name="input3" id="input3" rows=8 cols=80>Enter a third passage from an author of your choice.</textarea> <br> <br> <br> <textarea name="input5" id="input5" rows=8 cols=80>Enter a passage from a second author of your choice.</textarea> <br> <textarea name="input6" id="input6" rows=8 cols=80>Enter another passage from the second author of your choice.</textarea> <br> <textarea name="input7" id="input7" rows=8 cols=80>Enter a third passage from the second author of your choice.</textarea> <br> <br> <br> <textarea name="input8" id="input8" rows=8 cols=80>Enter a passage from a third author of your choice.</textarea> <br> <textarea name="input9" id="input9" rows=8 cols=80>Enter another passage from the third author of your choice.</textarea> <br> <textarea name="input10" id="input10" rows=8 cols=80>Enter a third passage from the third author of your choice.</textarea> <br> <br> <textarea name="Author1" id="Author1" rows=4 cols=40>Enter the first author's name.</textarea> <br> <textarea name="Author2" id="Author2" rows=4 cols=40>Enter the second author's name.</textarea> <br> <textarea name="Author3" id="Author3" rows=4 cols=40>Enter the third author's name.</textarea> <br> <br> <textarea name="input4" id="input4" rows=8 cols=80>Enter the passage by the author to be determined.</textarea> <br> <input type="button" id="button" name="button" onClick="allThatStuff()" value="Determine the Author!"> <br> <textarea name="Output" id="Output" rows=4 cols=40 readonly></textarea> </form> <script type="text/javascript"> var form = document.getElementById("theForm"); form.input4.onclick = function( ) { var Author1 = form.Author1.value var Author2 = form.Author2.value var Author3 = form.Author3.value var TextInput = form.Input1.value; var TextInput0 = form.Input2.value; var TextInput1 = form.Input3.value; var TextInput2 = form.Input5.value; var TextInput3 = form.Input6.value; var TextInput4 = document.form.Input7.value; var TextInput5 = form.Input8.value; var TextInput6 = form.Input9.value; var TextInput7 = form.Input10.value; var TextInput8 = form.Input4.value; var sentences = TextInput.split("."); var sentences0 = TextInput0.split("."); var sentences1 = TextInput1.split("."); var sentences2 = TextInput2.split("."); var sentences3 = TextInput3.split("."); var sentences4 = TextInput4.split("."); var sentences5 = TextInput5.split("."); var sentences6 = TextInput6.split("."); var sentences7 = TextInput7.split("."); var sentences8 = TextInput8.split("."); var SentencesPerText = sentences.length var SentencesPerText0 = sentences0.length var SentencesPerText1 = sentences1.length var SentencesPerText2 = sentences2.length var SentencesPerText3 = sentences3.length var SentencesPerText4 = sentences4.length var SentencesPerText5 = sentences5.length var SentencesPerText6 = sentences6.length var SentencesPerText7 = sentences7.length var SentencesPerText8 = sentences7.length var WordsTotal = 0; var WordsTotal0 = 0; var WordsTotal1 = 0; var WordsTotal2 = 0; var WordsTotal3 = 0; var WordsTotal4 = 0; var WordsTotal5 = 0; var WordsTotal6 = 0; var WordsTotal7 = 0; var WordsTotal8 = 0; for ( var i = 0; i < SentencesPerText; ++i ) { var sentence = sentences[i]; var words = sentence.split(" "); WordsTotal += words.length; } for ( var i = 0; i < SentencesPerText0; ++i ) { var sentence0 = sentences0[i]; var words0 = sentence0.split(" "); WordsTotal0 += words0.length; } for ( var i = 0; i < SentencesPerText1; ++i ) { var sentence1 = sentences1[i]; var words1 = sentence1.split(" "); WordsTotal1 += words1.length; } for ( var i = 0; i < SentencesPerText2; ++i ) { var sentence2 = sentences2[i]; var words2 = sentence2.split(" "); WordsTotal2 += words2.length; } for ( var i = 0; i < SentencesPerText3; ++i ) { var sentence3 = sentences3[i]; var words3 = sentence3.split(" "); WordsTotal3 += words3.length; } for ( var i = 0; i < SentencesPerText4; ++i ) { var sentence4 = sentences4[i]; var words4 = sentence4.split(" "); WordsTotal4 += words4.length; } for ( var i = 0; i < SentencesPerText5; ++i ) { var sentence5 = sentences5[i]; var words5 = sentence5.split(" "); WordsTotal5 += words5.length; } for ( var i = 0; i < SentencesPerText6; ++i ) { var sentence6 = sentences6[i]; var words6 = sentence6.split(" "); WordsTotal6 += words6.length; } for ( var i = 0; i < SentencesPerText7; ++i ) { var sentence7 = sentences7[i]; var words7 = sentence7.split(" "); WordsTotal7 += words7.length; } for ( var i = 0; i < SentencesPerText8; ++i ) { var sentence8 = sentences8[i]; var words8 = sentence8.split(" "); WordsTotal8 += words8.length; } var Author1Name = form.Author1.value var Author2Name = form.Author2.value var Author3Name = form.Author3.value var WordsPerSentence = WordsTotal/SentencesPerText var CharsTotal = TextInput.replace(/[\s\.]/g).length; var WordsPerSentence0 = WordsTotal0/SentencesPerText0 var CharsTotal0 = TextInput0.replace(/[\s\.]/g).length; var WordsPerSentence1 = WordsTotal1/SentencesPerText1 var CharsTotal1 = TextInput1.replace(/[\s\.]/g).length; var WordsPerSentence2 = WordsTotal2/SentencesPerText2 var CharsTotal2 = TextInput2.replace(/[\s\.]/g).length; var WordsPerSentence3 = WordsTotal3/SentencesPerText3 var CharsTotal3 = TextInput3.replace(/[\s\.]/g).length; var WordsPerSentence4 = WordsTotal4/SentencesPerText4 var CharsTotal4 = TextInput4.replace(/[\s\.]/g).length; var WordsPerSentence5 = WordsTotal5/SentencesPerText5 var CharsTotal5 = TextInput5.replace(/[\s\.]/g).length; var WordsPerSentence6 = WordsTotal6/SentencesPerText6 var CharsTotal6 = TextInput6.replace(/[\s\.]/g).length; var WordsPerSentence7 = WordsTotal7/SentencesPerText7 var CharsTotal7 = TextInput7.replace(/[\s\.]/g).length; var WordsPerSentence8 = WordsTotal7/SentencesPerText7 var CharsTotal8 = TextInput7.replace(/[\s\.]/g).length; var inputAverage11 = (CharsTotal + CharsTotal0 + CharsTotal1 + sentences.length + sentences0.length + sentences1.length + WordsTotal + WordsTotal0 + WordsTotal1 + WordsPerSentence + WordsPerSentence0 + WordsPerSentence1); var inputAverage21 = (CharsTotal2 + CharsTotal3 + CharsTotal4 + sentences2.length + sentences3.length + sentences4.length + WordsTotal2 + WordsTotal3 + WordsTota4 + WordsPerSentence2 + WordsPerSentence3 + WordsPerSentence4); var inputAverage31 = (CharsTotal5 + CharsTotal6 + CharsTotal7 + sentences5.length + sentences6.length + sentences7.length + WordsTotal5 + WordsTotal6 + WordsTotal7 + WordsPerSentence5 + WordsPerSentence6 + WordsPerSentence7); var inputAverage1 = (inputAverage11 / 12); var inputAverage2 = (inputAverage21 / 12); var inputAverage3 = (inputAverage31 / 12); var input4 = (CharsTotal8 + sentences8.length + WordsTotal8 + WordsPerSentence8); var no = "no" var yes = "yes" for (i = 0; i < 15; ++i) {if input4 = (inputAverage1 + i) {var Author1="yes" var Author1Off = i } ++i } var j = 0 while(j<15) {if input4 = (inputAverage1 - i) {var Author1="yes" var Author1Off = i } ++j } var i = 0 while(i<15) {if input4 = (inputAverage2 + i) {var Author2="yes" var Author2Off = i } ++i } var j = 0 while(j<15) {if input4 = (inputAverage2 - i) {var Author2="yes" var Author2Off = i } ++j } var i = 0 while(i<15) {if input4 = (inputAverage3 + i) {var Author3="yes" var Author3Off = i } ++i } var j = 0 while(j<15) {if input4 = (inputAverage3 - i) {var Author3="yes" var Author3Off = i } ++j } if (Author1 = yes) { if (Author2 = yes) { if (Author3 = yes) { if (Author1Off < Author2Off) { if (Author1Off < Author3Off) { form.Output.value = (Author1Name + " is the author!") } else { form.Output.value = (Author3Name + " is the author!") } } else if (Author2Off < Author3Off) { form.Output.value = (Author2Name + " is the author!") } else { form.Output.value = (Author3Name + " is the author!") } } else if (Author1Off < Author2Off) { form.Output.value = (Author1Name + " is the author!") } else { form.Output.value = (Author2Name + " is the author!") } } else if (Author3 = yes) { if (Author1Off < Author3Off) { form.Output.value = (Author1Name + " is the author!") } else { form.Output.value = (Author3Name + " is the author!") } } else { form.Output.value = (Author1Name + " is the author!") } } else if (Author2 = yes) { if (Author3 = yes) { if (Author3Off < Author2Off) { form.Output.value = (Author3Name + " is the author!") } else { form.Output.value = (Author2Name + " is the author!") } } else { form.Output.value = (Author2Name + " is the author!") } } else if (Author3 = yes) { form.Output.value = (Author3Name + " is the author!") } else { form.Output.value = "The author was unable to be determined." } } </script> </body> </html> Reply With Quote 01-16-2015, 02:53 PM #2 sunfighter View Profile View Forum Posts Senior Coder Join Date Jan 2011 Location Missouri Posts 4,830 Thanks 25 Thanked 672 Times in 671 Posts Please use code tags and put your code in them. It makes it easier on every one. Your input button calls the function allThatStuff(). Code: <input type="button" id="button" name="button" onClick="allThatStuff()" value="Determine the Author!"> But you do not have a function by that name. You only have a single function named Code: form.input4.onclick = function(){.....} But even getting that straight wont work when you have things like: Code: if input4 = (inputAverage2 + i){ var Author2="yes" var Author2Off = i } the if statement S/B Code: if ( input4 == (inputAverage2 + i) ) {....} I use the following code to create a hidden iFrame on a page, dynamically Code: var i = document.createElement('iframe'); i.style.display = 'none'; i.onload = function() { i.parentNode.removeChild(i);}; i.src = 'http://www.mysite.com'; document.body.appendChild(i); i.id='frame1'; Now, document.getElementById('frame1').contentDocument.getElementById('text01').value Should have given me the value in 'text01', but it doesn't. It doesn't work even inside the iFrame's onload event. ('text01' is a textbox which is on the page inside the iFrame - its name and id are both 'text01') Is there any other method to get the text in a textbox within an iFrame? Please help me to correct the code. Thanks in advance. Is there a method or a way to duplicate the text typed in one textarea to another, with onkeyup or onchange? The problem I'm facing is with FCKeditor. Two textareas with loaded templates and the text has to be manually copied and pasted when changed. Code: <form action="" method="post" name="form1" id="form1"> Subject:<br /> <input type="text" name="subject" value="Subject" size="32" /> <br /> Main Article:<br /> <textarea name="content" cols="50" rows="10"> <?php echo $row['article']; ?> </textarea> <br /> Text version:<br /> <textarea name="content_text" cols="50" rows="10"> <?php echo $row['article']; ?> </textarea> <input type="submit" value="Send" /> </form> I may be going about this all wrong? Send newsletters, it all works - not sure? do I need the second texarea. Hello, Can you someone point me to the right script? I have a text box and would like to see if the value of the input matches the values defined in a JavaScript array. For example, the JavaScript array will hold five values: v1 = Tom v2 = Jerry v3 = Michael v4 = Stephanie v5 = Michelle If the text box does not equal one of those values, an alert will pop up stating it does not match. Thanks. I have a simple password protection setup on my site but the password is displayed when it is typed in is there a way to change it to a # or * when it is typed in
Newbie here. I could not find the syntax how to set initial value he Code: var indat = window.clipboardData.getData ("Text"); . . . . . <input type="text" name="q" value="xxxxxx" size="40" /> I would like the value to be the indat var value I saw lot of samples with value="xxxxx" (hard coded value) but could not find sample for var value thanks for help !! I have an input element of type=text. It has a fixed width, but I want to expand that width as the user is typing if the text doesn't fit inside. I did something similar to this with <textarea> and the vertical height. PHP Code: // javascript in mootools textarea.addEvent('keyup', function(){ textarea.setStyle('height', this.getScrollSize().y ); }); Does anyone know of a way to do this with <input type='text'>? Hi guys, Let me explain simply what I do and what I'm trying to achieve: I got a couple of comboboxes were the user selects a series of numbers. Once a selection is made, the value is appended to an input box. The idea is that the appended values form a telephone number, or at least part of one, that will then be used to search trough a database to look for a matching number. The code below is what I have done so far: Code: <script type="text/javascript"> function displayIndicatif(){ var sel = document.getElementById("indicatif"); var text = sel.options[sel.selectedIndex].value; var out = document.getElementById("blabla"); out.value += text+"\n"; } function displayBloc(){ var sel1 = document.getElementById("bloc"); var text1 = sel1.options[sel1.selectedIndex].value; var out1 = document.getElementById("blabla"); out1.value += text1+"\n"; } </script> [...] <input type="text" id="blabla"/> [..] <select id="indicatif" onChange="displayIndicatif();"> <option value="021">021</option> <option value="022">022</option> <option value="031">031</option> </select> <select id="bloc" onChange="displayBloc();"> <option value="555" class="021">555</option> <option value="666" class="021">666</option> <option value="777" class="021">777</option> </select> Basically what happens now is this: combobox indicatif: 021 | 022 | 031 combobox bloc: 555 | 666 | 777 If I select "021" from indicatif, the script will append 021 to the input "blabla". The problem is, if I now select "022", the input will show "021022" instead of replacing the 021 with 022. What I would like is that, for each combobox, the script replaces the selected value with the new one instead of simply appending it, like instead of say 021022555666 it would show 021555 or 022666 or 021666 depending on what is selected...you get the idea? Is this doable? Needless to say I'm a total noob at javascript...I adapted the code I got now from some other guy who was trying to achieve almost the same thing and adapted it to my needs, or least, tried to, but now I'm stuck. Any help is appreciated! Thanks print "<Font face=\"calibri, Arial\"><table id=\"rnatable\" border=2px width=100%>"; print "<th></th>"; print "<th>a</th>"; print "<th>b</th>"; print "<th>c</th>"; print "<th>d</th>"; print "<th>e</th>"; print "<th>f</th>"; print "<th>g</th>"; while($array = mysql_fetch_array($sql_query)) { $id=$array['a']; print "<tr id=\"newtr\">"; print "<td><input id=\"check\" type=\"checkbox\" name=\"keyword[]\" value=\"$id\" ></td>"; print "<td>".$array['a']."</td>"; print "<td>".$array['b']."</td>"; print "<td>".$array['c']."</td>"; print "<td>".$array['d']."</td>"; print "<td>".$array['e']."</td>"; print "<td>".$array['f']."</td>"; print "<td> <a href=\"http://localhost/rnasearch/retrieve.php?a=$id\">bla</a> </td></tr></font>"; } print "</table>"; } this is part of a php searchengine script that i wrote to retrieve data from a database and as you can see the last column that is g contains a link which when clicked takes the user to the second php script which retrieves additional information of that entry, but this is done for only single entries so as you can see i introduced checkboxes so that the user can check any number of checkboxes and retrieve information as per their wish now to do this i created a <input type=text where i want the value of these checkboxes i.e. $id to be posted in a delimited format so that the user can then click the corresponding button and retrieve the information this is the code <div id="floatMenu"> <ul class="menu1"> <center><li><form name="senddata" method="POST" action="http://localhost/retrieve.php" style="display:inline;"><input id="fasta" type="text" class="multitext"><input name="Fasta" type="Submit" value="Retrieve Fasta"></form> this is a css floating menu....so far so good....everything went fine.... after this i had to write a javascript to do this and i've been stuck there searching forums for the last 4 days! this is the javascript i found from somewhere which came close to doing wht i wanted it to do window.onload = function () { var cb = document.getElementById('check'); var fasta = document.getElementById('fasta'); cb.onclick = function () {fasta.value = cb.value + ","; };}; this script only sends the value of the first checkbox in the table, the others are not found by it, mind you its not the first checkbox selected its the first checkbox that is present in the table how can i resolve this problem so that even if i have n number of checkboxes in my table, if the user chooses to do so they can retrieve n number of information....please help i've almost lost hope in this! Hi.. I have form and i want to input data using barcode and it will display on textbox and after input on the first textbox the focus will go to next textbox untill it will go on the last textbox and on the last textbox it will automatically save the data's on the database. How is it possible? here is my sample code: Code: <?php error_reporting(0); date_default_timezone_set("Asia/Singapore"); //set the time zone $con = mysql_connect('localhost', 'root',''); if (!$con) { echo 'failed'; die(); } mysql_select_db("mes", $con); ?> <html> <head> <script type="text/javascript"> function ini() { // Retrieve the code var code =document.getElementById ("code_read_box1").value; var code =document.getElementById ("code_read_box2").value; var code =document.getElementById ("code_read_box3").value; var code =document.getElementById ("code_read_box4").value; var code =document.getElementById ("code_read_box5").value; var code =document.getElementById ("code_read_box6").value; // Return false to prevent the form to submit return false; } </script> </head> <body onLoad="document.barcode.code_read_box1.focus()"> <form name=barcode onsubmit = "return ini()"> <input type="text" id="code_read_box1" value="" /><br/> <input type="text" id="code_read_box2" value="" /><br/> <input type="text" id="code_read_box3" value="" /><br/> <input type="text" id="code_read_box4" value="" /><br/> <input type="text" id="code_read_box5" value="" /><br/> <input type="text" id="code_read_box6" value="" /><br/> </form> </body> </html> Hello. I've been teaching myself HTML and CSS for a while, and now I've moved into the world of Javascript (but I'm still very much a beginner). For practice, I've been building a sample sign up form for a mock website, and I'm having problems with the birthdate section. The idea I had was to have MM, DD, and YYYY be the default values of my 3 textboxes (as an example for users), then set the value to nothing when the box gained focus. That all works fine, but I ran into problems when I tried to write an if statement to set the value back to MM, DD, or YYYY if the value was still nothing when the user clicked away. As it is now it just replaces the text inputted into the textbox (which of course is not good). Any ideas for what the problem might be? Code: <form name="signup" action="javascript:void(0);" method="post"> <table> <tr> <td>Date Of Birth:</td> <td> <input name="DOBmonth" type="text" value="MM" size="2" style="color: #555555;" onFocus="clearDOBmonth()" onBlur="restoreDOBmonth()" /> <input name="DOBday" type="text" value="DD" size="2" style="color: #555555;" onFocus="clearDOBday()" /> <input name="DOByear" type="text" value="YYYY" size="4" style="color: #555555;" onFocus="clearDOByear()" /></td> </tr> <tr> <td></td> <td><button name="Submit" type="submit" style="font-size: 1em;">Sign Up</button></td> </tr> </table> </form> <script type="text/javascript" language="javascript"> <!-- document.signup.DOBmonth.value="MM"; document.signup.DOBday.value="DD"; document.signup.DOByear.value="YYYY"; function clearDOBmonth() { document.signup.DOBmonth.value="";} function clearDOBday() { document.signup.DOBday.value="";} function clearDOByear() { document.signup.DOByear.value="";} function restoreDOBmonth() { if ('document.signup.DOBmonth.value = ""') { document.signup.DOBmonth.value = "MM"; // alert(document.signup.DOBmonth.value); } } //--> </script> Another side question, if I set a variable equal to the value of a textbox, then change the value of the variable, does that also change the value of the textbox? or is the variable no longer associated with the textbox. Example: Code: var a = document.form.textbox.value; a = blue; does document.form.textbox.value = blue? or is var a now completely independent of the textbox value? Thanks! 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! Hi gud mng, I have one problem... How to process textbox values/ call textbox values in JS through a Java program. My text box values are dates. I have to process these dates. Like in online banking we select day to know our transactions. After submitting we get results. remember my files are in my directory only. No need of database. My files are look like 20100929, 20100930, 20101001 For epoch_classes.js, epoch_styles.css u can download coding from this link : http://www.javascriptkit.com/script/...ch/index.shtml Code: Code: <html> <table width="900" border="0" cellpadding="10" cellspacing="10" style="padding:0"> <tr><td id="leftcolumn" width="170" align="left" valign="top"> <div style="margin-left:0px;margin-top:0px"><h3 class="left"><span class="left_h2">Select Option</span></h3> <a rel="nofollow" target="_top" href="day_wise.htm" >Day-wise</a><br /> <br /> <a rel="nofollow" target="_top" href="between.htm" >Between Days</a> <link rel="stylesheet" type="text/css" href="epoch_styles.css" /> <script type="text/javascript" src="epoch_classes.js"></script> <script type="text/javascript"> var cal1, cal2; window.onload = function () { cal1= new Epoch('epoch_popup','popup',document.getElementById('popup_container1')); cal2= new Epoch('epoch_popup','popup',document.getElementById('popup_container2')); }; /*............*/ function confirmation(f) { var startdate = f.fromdate.value var enddate = f.todate.value var myday=new Date() var yr=myday.getFullYear() var mn=myday.getMonth()+1 var dt=myday.getDate() var today="" var present, ys, ms, ds, ye,me,de, start, end if(mn < 10) { mn = "0" + mn } if(dt <10) { dt = "0" + dt } today= yr + "/" + mn + "/" + dt present=yr + "/" + mn + "/" +dt if (today < startdate ) { alert (" Start date should not be exceed to-day's date " + present ) startdate.focus() return false } if (today < enddate ) { alert (" End date should not be exceed to-day's date " + present ) enddate.focus() return false } if (today == startdate ) { alert(" You are selected to-days date as Starting day" ); } var answer = confirm("Do you want to continue ?") if (answer) { if( startdate < enddate) alert("Dates between " + startdate + " to " + enddate + " are confirmed" ) else alert("Dates between " + enddate + " to " + startdate + " are confirmed" ) } else { alert("Date not confirmed") window.location="to_date.htm"; } ys= startdate.substring(0,4); ms= startdate.substring(5,7); ds= startdate.substring(8,10); start=ys + "" + ms + "" +ds ye= enddate.substring(0,4); me= enddate.substring(5,7); de= enddate.substring(8,10); end=ye + "" + me + "" +de } /*.......................................................*/ </script> <div style="margin-left:100px;"> <body> <style type="text/css"> #conf { margin-left:115px; } </style> <td align="left" valign="top"> <table width="100" border="0" cellpadding="0" cellspacing="0"> <td style="padding-top:0px"> </table> <h4>From Date</h4> <form name= "formbet" id="placeholder" method="post" action="#" > <input id="popup_container1" type="text" name= "fromdate" maxlength="10" size="20"/> <td align="left" valign="top"> <table width="300" border="0" cellpadding="0" cellspacing="0"> <td style="padding-top:20px"> <h4>To Date</h4> <input id="popup_container2" type="text" name= "todate" maxlength="10" size="20"/> <br /> <br /> <input id="conf" type="button" onclick="confirmation(this.form)" value="Submit"> </form> </body> </html> In my coding, ys, ms, ds represents year starting, month starting, starting day... ye, me, de represents end... start,end gives file names in the format of yyyymmdd now i want to process files from 20100101 to 20100930 means from date is 2010/01/01 and to date is 2010/09/30 if i press submit button the files from 20100101 to 20100930 are processes here ys=2010 ms=01 ds =01 and ye=2010 me=09 de= 30 For this how do i call these textbox values (from date text box and todate) to another program (java) Thanks in advance. suggestions welcome !!
How would you make a password feild and a retype password feild and they have to be the same?
Hi, i got a textbox with a submit button but when submit button is clicked it works but it reloads the page. is possible to submit without reload the page? thanks |