My Little Spot on the Net

March 10, 2006

HOWTO : Lock Form Field

Filed under: Howto's

Sedikit coba-coba dengan event di javascript, akhirnya menu satu trik sederhana untuk mengunci form agar tidak bisa di-edit tanpa menambahkan atribut readonly maupun disable.
Berikut caranya :
<form name=form>
<input type=text name=box value="Locked text!" onFocus="this.blur()" size=12>
</form>
.
Perhatikan pada event onFocus, kita beri dia perintah this.blur(), sehingga field tersebut tidak pernah menerima focus.

3 Comments »

The URI to TrackBack this entry is: http://bayu.blogsome.com/2006/03/10/howto-lock-form-field/trackback/

  1. huehue!
    gak terpikirkan.

    thanks yo

    Comment by didats — March 10, 2006 @ 3:32 am

  2. salah fokus?

    Comment by basibanget — March 10, 2006 @ 4:43 am

  3. Ya… gitu deh.

    Comment by Arief Bayu Purwanto — March 10, 2006 @ 6:17 am

RSS feed for comments on this post.

Leave a comment

Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>























Get free blog up and running in minutes with Blogsome
Theme designed by Ben de Groot