Thursday, November 19, 2009

Browser Compatibility Problem Solved !!



In some web sites need to enter the password to log in. And when you type the password, it will display as dots.(Instead of showing the password characters). This password mask will done by the changing input field type.
------------------------------------------------------------------------------
<input name="pw" value="" type="passowrd"/>
------------------------------------------------------------------------------
This will appear normal input field in a html page. But, when you type something on it, it will show as dots.
But, we need to display the text "Password" inside this box and when user click on this, the text should clear. Clearing stuff can be done by java script easily. But problem is this.

If we need to display the text inside the text box, we can do this.
--------------------------------------------------------------------------------
<input name="pw" value="Password" type="passowrd" />
--------------------------------------------------------------------------------
ohhhh... Then it will display as dots !!!

Then what can I do ? One option is change the type from "text" to "password" from java script..
Yes. It works on Firefox. But on internet explorer ???

What a ugly browser is ? IE doesn't support on this dynamic field change !!! Then try to clone nodes and replace parent. It works, but reverse is not !!!

This is the simplest solutioncc to over come in such problems... Use dummy field !!!

----------------------------------------------------------------------------

<input name="pwd_dummyfield1" style="width: 140px;" id="pwd_dummyfield1" value="Password" onfocus="changePassword(true,'passWord_-3','pwd_dummyfield1');" type="text">

<input name="passWord_-3" style="width: 140px; display: none;" id="passWord_-3" onblur="changePassword(false,'passWord_-3','pwd_dummyfield1');" type="password">

<script type="text/javascript">
function changePassword(change,id,dummyid)
{
var dummy = document.getElementById(dummyid);
var actual = document.getElementById(id);

if(change)
{
dummy.style.display = 'none';
actual.style.display = 'block';
actual.focus();
}
else
{
if(actual.value.length == 0)
{
dummy.style.display = 'block';
actual.style.display = 'none';
}
}
}
</script>
-------------------------------------------------------------------------------------

SONY TY voltage regulation problem



I have SONY KV-G 21 type 21 inch color TV, which was bought by my father 10 years ago. It works well for us more than, with small repairs. But from month ago, it had ugly fault. Sometimes, the image reduces from horizontal and stretch vertical and sound get stuck.

Unfortunately, when I remove the cover and try to test it...... Oh fault is not there and TV works fine !!!! What a headache. But, after two or three days, same story comes again..... OOOOHHHH..

In last Sunday, again I remove the back cover, and test the TV. I detect some sudden voltage drop form both 15V and 115V power supply outputs. According to the power supply design, 115V line is fully regulated, but it was 108V at that time !!!

Ohhhh.... This may happen with over loading, but my multi meter reading shows it's not. Then fault should be either primary side of the SMPS or in the secondary side.. The TV designers use STR-S 6707 as off line SMPS.

I just check the voltage across the opto isolater PC123 from secondary side, it varies.... It must be, but cannot present voltage if the supply is less than 115 V. !!! Nothing to say, the fault is in the SE115 - error amp IC. I just replace it and all come normal :-)

Wednesday, November 18, 2009

Nuwan's Home

This is my first post on blog :-) I will use this blog for recovered technical and related posts. Most of them will be related with electronics and micro controller related things. As well as I will put some important notes related with any area.....