How can textfields exclude each other, without skipping the tab-order


hello there

 

i've created form, using acrobat 7.0 pro on windows.

there textfields next each other, might exclude neighbor.

 

i have no actual experience in using javascript. i've got far, scratched browsing though internet , trial , error.

 

 

in form, entry in 1 field, sets 1 ".readonly = true"

if change mind , delete entry of first one, other 1 supposed set ".readonly = false" again.

 

problem:

the 2nd field next in tab-order. on blur, field (where make entry instead) being skipped, because @ time of event, still readonly. (tab-order set)

 

 

after browsing internet day, i've come 2 approaches, both relying on keystroke event:

 

//----------first approach---------

 

if(!event.willcommit)

{

    if(event.value == "" && this.getfield("breite").value == "")

    {

        this.getfield("durchmesser").readonly =false

    }

    else

    {

        this.getfield("durchmesser").readonly = true

    }

}

 

 

/*

error:

after deleting entry, term(event.value) not being checked until pressing next key.

then next field being enabled again, other field not empty anymore.

*/

 

 

 

// ---------------2nd approach----------------

 

 

if(!event.willcommit)

{

    if(!event.value == "" && !this.getfield("breite").value == "")

    {

        this.getfield("durchmesser").readonly = true

    }

}

else

{

    if(event.value == "" && this.getfield("breite").value == "")

    {

        this.getfield("durchmesser").readonly =false

    }

}

 

 

/*

error:

the term resolves while/after committing.

the next field being skipped.

the readonly set afterwards

i'd better off simple on blur event instead

*/

 

 

have another/working solution?

 

thanks in advance.

this seems work first field's custom keystroke event:

 

this.getfield("durchmesser").readonly = (afmergechange(event)!="");



More discussions in PDF Forms


adobe

Comments

Popular posts from this blog

Thread: Can not create raid array: mdadm: no raid-devices specified.

Thread: HOW TO: Package and theme GTK+ / Gtkmm apps in Linux for Windows

Thread: Twinview issues