JavaScript - How To Get The Text Within A Textbox Which Is Inside An Iframe?
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. Similar TutorialsI save an Access query as an HTML file (query.html) I then load an HTML page (TopStyle.html). This loads the query.html. I want query.html to autoscroll to the end of the page, and then either scroll to the top or just start again. [code] <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <script type="text/javascript" language="JavaScript" ></script> <title>How to Scroll the Page With JavaScript</title> <meta name="description" content="How to scroll the page automatically using JavaScript." /> <meta name="keywords" content="javascript, page, scroll" /> <script type="text/javascript"> function pageScroll() { window.scrollBy(0,50); scrolldelay = setTimeout('pageScroll()',10000); // scrolls every 1000 milliseconds } </script> </head> <iframe src="file:///D:/PrivateDocs/WorkflowPage/Query1.html" name="frame1" scrolling="auto" frameborder="no" style="float:left" height = "100%" width = "100%"></iframe> <body> <body onLoad="pageScroll()"> </body> </html> [icode] Problem 1 is I can't get the height 100% to work. I get a box about 150px high. Problem two is the main HTML page does a small scroll but how do I get the Query in the Iframe to scroll? All help appreciated. Harle Hi I have this page below which I run locally that is created dynamically: I need a piece of javascript to focus on the captcha as shown in the image inside the green box. At this minute I have this which doesn't work all that great for some reason but it gets it to the general area... Code: if (( document.URL.indexOf("cast_skills") != -1 ) || ( document.URL.indexOf("security_prompt") != -1 ) || ( document.URL.indexOf("joinraid") != -1 )){ if ( document.forms.length > 0 ) { document.forms[0].elements[1].focus(); } } As I said this does the job to some extent however it does not leave the focus in a perfect position so that the captcha is readable and the text box visible to type in, as illustrated in the red box in the above image. Help with this would be great. Many thanks, David. Hi, folks! Having a big issue he i got a code that works fine in Chrome, FF, but seems unreadable by IE. Got a main HTML code that have a DIV tag, declared like this Code: <div id='leframe' style='visibility:hidden'></div> Then, I call, through a Flash file, an external function that says: Code: function loadNextPg(nextPg) { var varDiv = "<iframe src='pg"+nextPg+".htm'></iframe>"; document.getElementById("leframe").innerHTML = varDiv; } } It would load the HTML named (pg'+nextPg+'.htm), where nextPg is a String value ("01", "02", etc). It works WONDERFULLY in Chrome, FF, etc, but not in IE. Does anyone know if I'm doing anything wrong? Best regards and thanks in advance. Alright so I've been teaching myself php/javascript/html/joomla for the past couple weeks, learning as i go along. So bear with me if i seem like a total moron =p. I'm trying to run a script from a js file to add javascript to the website inside the iframe. I also would like the script to only be activated onclick(this is all in an article). To clarify my website has an iframe and this iframe contains a webpage from http://website987.com/. I want to run thescript.js on the website inside that iframe, to add javascript to that website, however i also only want to run this js file on the click of a link/button. I hope i'm being clear if I'm not please tell me and ill try to reiterate. I've been trying to get this to work for a while now and I feel like this is really simple and I'm asking a stupid question. However this is what I've got so far, currently this just redirects the iframe to the URL with my code on it(instead of actually running it).How could i edit this/what coding could I use to make it so thescript.js actually runs instead of it being just redirected? Reply With Quote Code: <?php $filename = 'thescript.js'; $path = '/media/system/js/'; // add the path parameter if the path is different than : 'media/system/js/' JHTML::script($filename, $path, true); // MooTools will load if it is not already loaded ?> Code: <HTML> <HEAD> <script language="javascript"> function loadOne() { parent.FRAME1.location.javascript: function('/media/system/js/thescript.js') } </script> </HEAD> <BODY> <iframe name="FRAME1" src="http://website987.com/" width="740" height="500" frameborder="0" scrolling="yes"></iframe> <a href="javascript:loadOne()">Click Here/a> </BODY> </HTML> Am i even on the right track? I've been testing out a billion different codes and I think it would be ridiculous to post them all so I was hoping someone could help me fix this code or at least point me in the right direction. I'm usually able to figure everything out on my own but I'm failing atm and I just need help on this one thing, I would be ever so thankful for any assistance provided, ! (BTW I'm also currently using the Joomla CMS and a joomla plugin called CodeMirror that runs your code directly from the article, not sure if this is relevent or not) I have a form inside an iFrame which I want to submit with javascript as the iFrame loads. For example: Code: <iframe src="......." name="myiframe" id="myiframe"> <form method="post" id="myform" name="myform" action="http:// www.yahoo.com" rel="nofollow" target="_self"> </form> </iframe> No matter how I try to submit the form I cannot get it. I have tried: document.getElementsByName("myform") document.myiframe.myform all other combinations I try gives the same, i cannot access the form. (The page inside the iFrame is from the same domain as the parent page, I am not trying to do any cross domain scripting) Can you please assist me getting this working ? Thanks! how would you make a function that cheks if any text is in a text box.
Hi, I'm stumped at the moment trying to make something a little like seen on Google Maps where you can search the location in text box and the map corresponding to the location will be dispalyed. Can any one send me the Javascript for the following in which my image is paced in an iframe and the upon entering the loaction in a textbox it image must move to that position witin the iframe. Any help will be appreciated. Regards, Sreejith 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) ) {....} Basically 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 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 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.
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> Hi folks, I need your help. I couldn't find much reference material out there (if any) on the web, so I am turning to the help of the gurus and experts on this forum. How can I make a listbox, such that when an item is highlighted, and I click on the 'Rename' button at the top, an input box with the <li>'s current value will be placed in the same spot as the selected LI value and the user will then proceed to have the option to rename the li item. The changes are then saved if the lisbox has lost its focus. Examples of this functionality are that similar to the way Windows renames its files, ie. when you click "rename" the list item becomes an input box for the user to rename the file. I'd ideally like to mock the same functionality and apply it to a UL. For the sake of keeping things plain and simple, I am also jQuery friendly. Here's a fiddle: Edit fiddle - JSFiddle Code: <!DOCTYPE html> <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script type="text/javascript"> $(function(){ $('li').click(function(){ $('li.active').removeClass('active'); $(this).addClass('active'); }); }); </script> <style type="text/css"> .active { background-color: rgb(128,128,128); } #colors { border: 1px solid #000; width: 100px; list-style: none; margin: 0; padding: 2px; } </style> </head> <body> <input type="button" value="raname" onclick="renameLi()"> <ul id="colors"> <li>red</li> <li>green</li> <li>blue</li> <li>yellow</li> <li>orange</li> <li>purple</li> </ul> </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! Can anyone tell me role of () after a function or so and mainly the function of text inside it? for example how is function stuff (a) { } different from function stuff (b) { } or simply from function stuff () { } ? udayanga0727@yahoo.comI need to a code to do the following. There is a Text Area that user can enter text. assume that user enter something and put a dot Following values should be populate in a drop down at the place where dot locate . -Hello -Hi _Test like when we get the string object using Net Beans IDE and when we put "Object." , drop down will be displayed with available methods for that particular object. idea is to build a editor using java script. can any one help me on this? Hi Guys, I am new to this forum,based on the combobox value,I am creating a textboxes dynamically in jsp .Based on the count of textboxe's the textarea content comes with <value1> like this... Here i tried like this, <html> <head> <script> function copy_data(val,id,textareaValue){ var enteredText = val; alert("enteredText -----------"+enteredText); var boxId= id; alert("boxId-----------"+boxId); var textValue= textareaValue; alert("textValue-----------"+textValue); var beforeBrac = textValue.substring(0,textValue.indexOf("<")); alert("beforeBrac -----------"+beforeBrac ); var inbracket = textValue.substring(beforeBrac.length+1,textValue.indexOf(">")); alert("inbracket -----------"+inbracket); if(boxId = "1"){ inbracket = val; } alert("inbracket -----------"+inbracket); var afterBrac = textValue.substring(textValue.indexOf(">"),textValue.length); alert("afterBrac -----------"+afterBrac ); var fstr = beforeBrac +"<"+inbracket +afterBrac ; if(boxId == "1"){ document.getElementById('txtArea').value = fstr; alert("final str value is"+fstr); } } </script> </head> <body> <input type="text" name ="a" id="1" onkeyup="copy_data(this.value,this.id,document.getElementById('txtArea').value)"/> <input type="text" name ="a" id="2" onkeyup="copy_data(this.value,this.id, document.getElementById('txtArea').value)"/> <textarea rows="2" cols="20" id="txtArea"> At W3Schools you <will> find all <the> Web-building tutorials <you> need, from basic HTML to advanced <XML>, SQL, ASP, and PHP. </textarea> </body> </html> three text boxes with some value [ value1 ] [value2] [value3 ] this is the text area content:- At W3Schools you <will> find all <the> Web-building tutorials <you> need, from basic HTML to advanced XML, SQL, ASP, and PHP. the output should be :- At W3Schools you <value1> find all <value2> Web-building tutorials <value3 > need, from basic HTML to advanced XML, SQL, ASP, and PHP... But i can't get it exactly..When i enter or delete the value it should replaced in the proper <> correctly.. If i enter the value in 1st textbox it should replace the value 1st <>.same for others also...Any Idea's ?Plz suggest me ... Hello I need to get text from an iframe. I tried this example (I've found it on this board): Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Example</title> <style type="text/css"> </style> <script type="text/javascript"> // <![CDATA[ window.onload = function() { // treat iframe_window as if it were your iframes window (which it is) var iframe_window = window.frames["my_iframe"]; // compare the following line to: window.document.getElementsByTagName("body")[0].innerHTML; var iframe_body_html = iframe_window.document.getElementsByTagName("body")[0].innerHTML; alert(iframe_body_html); } // ]]> </script> </head> <body> <iframe name="my_iframe" id="my_iframe" src="example.html"></iframe> </body> </html> but it works only with window.onload event. I need to get this text dynamically (e.g. on click). could you give me some example? Regards. Hello all, As this is an active javascript programming forum...i'm really hoping i'll get a solution for my problem...please help me out.... I have a html: text inside a logic:iterate block like this.. <logic:iterate name="AllocationsForm" property="newSearchAllocations" id="allocations" indexId="myindex" > <html:text name="allocations" property="newStartDate" indexed="true" onblur="allocationTest(this, " + myindex + ");" /> </logic:iterate> i want to write a onblur event for this text field inorder to validate it. Is it the correct way i wrote or something i need to make a change in the above code inorder for the javascript to work. Can we really able to write a onblur event for a indexed text field that is inside a logic:iterate block. please let me know. Thanks in advance. Hi guys, I need to redirect a page to another url when it detects that the page is opened inside an iframe. I need help with this <script > if(location.href != top.location.href){ window.location = 'http://myurl.com' } </script> - check my attachment index.zip Thx. |