reneeccwest said:
<input type="text" size="7" name="test" maxlength="4" value="4Tyourname">
Is there any way I can make first 2 characters as a read only value?
If it really is read-only, then make it read-only:
<style type="text/css">
span.outline {
font-family: monospace;
border: 2px inset;
}
@media screen,print {
span.outline {
padding: 1px;
}
input.noBorder {
font-family: monospace;
border: none;
}
}
</style>
<form>
<input type="hidden" name="testHidden" value="4T">
<span class="outline">4T<input type="text" size="9" name="test" maxlength="8"
value="yourname" class="noBorder"></span>
</form>
When the submitted data arrives at the server, concatenate the contents of
testHidden and test together.
Of course it doesn't look so hot in Netscape 4.x, but it's not completely
unusable, and in more modern browsers you get a funky input box where the
first two characters appear to be "read-only". The only browser I'm really
disappointed at is Opera 7.11. It refuses to honor border:none on the input
element.
--
| Grant Wagner <
[email protected]>
* Client-side Javascript and Netscape 4 DOM Reference available at:
*
http://devedge.netscape.com/library/manuals/2000/javascript/1.3/reference/frames.html
* Internet Explorer DOM Reference available at:
*
http://msdn.microsoft.com/workshop/author/dhtml/reference/dhtml_reference_entry.asp
* Netscape 6/7 DOM Reference available at:
*
http://www.mozilla.org/docs/dom/domref/
* Tips for upgrading JavaScript for Netscape 7 / Mozilla
*
http://www.mozilla.org/docs/web-developer/upgrade_2.html