Hi,
I am upgrading my application from oxf v2.6 to 2.7.2. What I found out is till oxf 2.6 the xpath mapping of the fields in the forms used to contain the name of the instance element in it after xforms processing is done and page is rendered to the browser (can be seen in veiw source of the page). ex.
<input type="text" name="TXLife[19]/A_FirstName_PINS[34]" value="" title="Enter First Name here" size="25" handleEnter(document.forms[0],this, event)" style="background-color:#FFFFFF">
We used the element name ( i.e. A_FirstName_PINS specified above in the name attribute) in _javascript_ for implementing client side validation for required fields.
But in oxf v2.7.2, this has been changed to the following:
<input type="text" name="$node^190" value="" title="Enter First Name here" size="25" handleEnter(document.forms[0],this, event)" style="background-color:#FFFFFF">
Here the name attribute contains a node number instead of node name. As a result our _javascript_ functions have stopped working.
_javascript_ code snippet:
for (var i = 0; i < form.elements.length; i++) {
if (form[i].type != 'hidden') {
for(var j=0; j < elems.length-1; j++){
if (form[i].name.indexOf(elems[j]) !=-1){
var value = form[i].value;
if (value==""){
focus(form[i].name);
return false;
}
}
}
}
}
Is there any way I can now identify the form fields with instance data in _javascript_?
Thanks
Anindita
----------------------------------------------------------------------------------------
This is a PRIVATE message. If you are not the intended recipient, please delete without copying and kindly advise us by e-mail of the mistake in delivery. NOTE: Regardless of content, this e-mail shall not operate to bind CSC to any order or other contract unless pursuant to explicit written agreement or government initiative expressly permitting the use of e-mail for such purpose.
----------------------------------------------------------------------------------------
- Re: [orbeon-user] form fields' name attribute changed in... Anindita Goswami
- Re: [orbeon-user] form fields' name attribute chang... Alessandro Vernet
