that's original way i use, but i don't understand why IE can't work.
i put the source below here to my form block
...
<script type="text/javascript">
var no = document.getElementById("id_no");
var no_check = document.createElement("no_check");
no_check.innerHTML = '<div id="NO_CHECK" style="cursor:pointer"
onclick="validate_no()">'
+ '</div>'
+ '<div id="NO_NOUSE" style="display:none"></div>';
no.parentNode.appendChild(no_check);
no.setAttribute("onKeydown", 'Element.update("NO_CHECK", " <img
src=http://mydomain/arrows.gif>");');
function validate_no() {
Element.update('NO_CHECK', '<img src="http://mydomain/
circle.gif">');
var ajaxCheckID = new Ajax.Updater ('NO_NOUSE', '/validate/'+$
('id_no').value+'/',
{ method: 'get', parameters: '', evalScripts: true });
}
</script>
</form>
...
This can work with firefox, but not IE. But this example is copied
from some one else, and original code can work in IE.
ps. i use prototype javascript library.
On 5月1日, 下午7時22分, Ivan Sagalaev <[EMAIL PROTECTED]> wrote:
> hoamon wrote:
> > how can i customize the fields in the newforms, or i walk the wrong
> > way ??
>
> What you described is an issue but I want to advice a different
> technique that doesn't suffer from this issue and also considered more
> robust.
>
> You shouldn't mix your HTML with Javascript, instead you should assign
> Javascript after the fact in a single place. For example:
>
> <label id='id_personalid'>ID</label>
> <input type='text' id='id_personalid'>
>
> ... and then somewhere in window.onload:
>
> document.getElementById('id_personalid').onkeydown = function() {
> // your code
> }
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---