processing checkbox parameters - browser differences
Hi all, My problem is this: I have a dtml method needs to pick up the values ONLY of checked checkboxes in an html form whose names are the ID's of objects users want to edit or delete. So the idea is that the object ids are passed to the method with the Request object and the appropriate objects can then be deleted or opened for editing in another html form. This works great in netscape 4.x but it doesn't work in IE 5 - it doesn't appear to be returning the checkboxes with the REQUEST - or perhaps not picking up that any are checked. Here is the code from the method that processes the form' action: <dtml-in "REQUEST.form.items()"> <dtml-let request_item_id=sequence-key> <dtml-in "objectValues('myObjectType')"> <dtml-if expr="id == request_item_id"> Do some stuff to the object here </dtml-if> </dtml-in> </dtml-let> </dtml-in> ------------------------------------------ Here is the code that instantiates the checkbox: <TD> <input type=checkbox name=<dtml-var id> value=1></TD> Anyone know how to deal with this? Sandy B
Sandy Britain wrote:
------------------------------------------ Here is the code that instantiates the checkbox:
<TD> <input type=checkbox name=<dtml-var id> value=1></TD>
Anyone know how to deal with this?
Not sure if this will fix the problem in IE but I enclosed the values in quotes and it works: <TD> <input type="checkbox" name="<dtml-var id>" value="1"></TD> HTH, -- Tim Cook, President - FreePM,Inc. http://www.FreePM.com Office: (731) 884-4126 ONLINE DEMO: http://www.freepm.org:8080/FreePM
With any problem like this, the first thing to do is to make sure what exactly the form is returning. You can use something like <dtml-var "REQUEST.form">. If that seems OK, then do the <dtml-in> iteration but just display the value rather than passing it to some other method or object. IE 5 will return check box values just fine. You should also check the html that the browser sees to make sure that it is exactly what you wanted. Also, if you have more than one check box with the same name, that can confuse your code (though I don't see why it would be different for IE vs NS). If the html isn't working right, hard code the html and work with it until it works right. Then rewrite your dtml to create that same html. If you have to ask the list about this after taking these steps, please show what the form's html looks like (remove any unnecessary elements), including encoding, method, and action. Cheers, Tom P [Sandy Britain]
I have a dtml method needs to pick up the values ONLY of checked checkboxes in an html form whose names are the ID's of objects users want to edit or delete.
...
This works great in netscape 4.x but it doesn't work in IE 5 - it doesn't appear to be returning the checkboxes with the REQUEST - or perhaps not picking up that any are
checked.
Here is the code from the method that processes the form' action:
<dtml-in "REQUEST.form.items()"> <dtml-let request_item_id=sequence-key>
<dtml-in "objectValues('myObjectType')"> <dtml-if expr="id == request_item_id">
...
Sandy Britain writes:
... checked checkboxes part of submitted data ... This works great in netscape 4.x but it doesn't work in IE 5 - it doesn't appear to be returning the checkboxes with the REQUEST - or perhaps not picking up that any are checked. I do not believe this.
In fact, I tested code today on Netscape and IE 5.5, that uses this feature and it worked perfectly for both browsers.
Here is the code from the method that processes the form' action:
<dtml-in "REQUEST.form.items()"> <dtml-let request_item_id=sequence-key>
<dtml-in "objectValues('myObjectType')"> <dtml-if expr="id == request_item_id"> Are you sure, the "id" of your objects is a member and not a method?
Try replacing "id" with "_['id']" or "_.render(id)". Dieter
participants (4)
-
Dieter Maurer -
Sandy Britain -
Thomas B. Passin -
Tim Cook