Jump to content

Rain Lover

  • Content Count

  • Joined

  • Last visited

Community Reputation

3 Neutral

About Rain Lover

  • Rank
  • Birthday 02/17/1979

Contact Methods

  • Website URL

Profile Information

  • Gender
  • Location
    Isfahan, Iran
  • Interests
    sports, music, Internet, reading, and travel

Recent Profile Visitors

1,982 profile views
  1. As you see the outline is collapsed in the following sample: var input = document.getElementById('input'); var output = document.getElementById('output'); input.addEventListener('input', function() { output.value = input.value; }); output { display: block; font: 20px Arial; outline: 1px solid green; } <input id="input"> <output id="output"></output> DEMO How can I prevent it? Do I need to give the output a fixed height? If so, what value should I give to the height if I want it to be just as high as the text height — not an arbitrary number? Is there a
  2. Scenario Every semester my students need to take at least one test. The following form gives the right average grade of a student: <!DOCTYPE html> <html lang="en"> <head> <title>Average Grade</title> </head> <body> <form> Math: <input type="number" id="test1"> <input type="number" id="test2"> <input type="number" id="test3"> <output id="average"></output> <br> <input type="button" value="Calculate" id="calcBtn"> </form> <script> document.g
  3. Steps to reproduce the issue: In your browser Settings select Continue where you/I left off under On startup. Navigate to the demo. Check the checkbox. Edit the text. Close your browser and reopen it. Or duplicate/clone the tab. Now as you see the checkbox is checked, but the textarea isn't colored. I tried it in the latest version of Chrome and Opera in Windows 10. I'm not sure about Safari, but it probably behaves the same way. Questions: Why does it happen? What's a cross-browser solution?
  4. Consider this: <input type="file" id="filePicker"> <script> document.getElementById('filePicker').onchange = function() { alert('Hi!'); }; </script> Even if you choose the same file and the filePicker value doesn't change, you'll see the alert box in Firefox. Any solutions?
  5. Yes, that seems to be the problem. Then I need to put my question this way: How to reload the parent frame that's located on a different frame?
  6. Sample parent code: <!DOCTYPE html><html><head><meta charset="UTF-8"><title>Parent</title></head><body><iframe src="https://dl.dropboxusercontent.com/u/4017788/Labs/child.html" width="200" height="100"></iframe></body></html> See it in action: https://googledrive.com/host/0B5jOXzxlxbMhYVF3b0lubjlDWm8/parent.html Sample child code: <!DOCTYPE html><html><head><meta charset="UTF-8"><title>Child</title></head><body><button onclick="myFunction();">Try it!</button>
  7. Thanks for the answer, but: I don't know how to do it using cURL. Would you mind providing a snippet to use as a template? Doesn't it break the layout when the target page has non-absolute URLs and relative links?
  8. When I embed an external HTTP iframe into my HTTPS page, I get a mixed content error message: <iframe src="http://www.example.com"></iframe> To work around this limitation I'd like to echo the external page from my own domain. How should I do that? Thanks!
  9. Sample form: <!DOCTYPE html><html><head><title></title><style type="text/css">* {font:13px arial; color:white;}body {background:black;}label {display:inline-block; width:50px;}input, textarea {margin:0; border:1px solid red; padding:0; background:green;}textarea {width:300px; height:100px;}</style></head><body><form action="#"><div><label for="entry_0">Name</label><input type="text" id="entry_0"></div><div><label for="entry_1">Email</label><input type="text" id="entry_1"></div
  10. I tried id, but it didn't work: var iframe = document.getElementById('target'); function displayResult() { if (textarea.value) { iframe.open(); iframe.write(textarea.value); iframe.close(); } window.setTimeout(displayResult, 10); } I also updated my question for clarification.
  11. I wonder why the following sample code doesn't work properly: <!DOCTYPE html><html> <head> <title></title> <style type="text/css"> textarea, iframe { display:block; width:300px; height:100px; margin:3px; padding:3px; border:1px solid #CCC; } </style> </head> <body> <textarea id="field" onfocus="getFocus();" onblur="loseFocus();">This is some text.</textarea> <iframe name="target"></iframe> <script> var textarea = document.getElementById('field'); var iframe = window.target.do
  12. Thanks for the answer! Do you know how I can display the focused field error?
  13. Objective: I'd like to display the focused field error message in a container. What I've done so far: <!DOCTYPE html><html><head><title></title><style type="text/css">label {display:inline-block; width:60px;}</style><script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js" type="text/javascript"></script><script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.9/jquery.validate.min.js" type="text/javascript"></script><script type="text/javascript">$(document).ready(function(){$("form").validate(
  14. Thanks for the answer, but I still don't understand the difference between the first and second example although I read your explanation a few times.
  15. In the second example the parent width is smaller than the child total width and the scrollbars should appear.
  • Create New...