I need to write to a Filemaker database from the information filled out on a web form.
I am using JSP.
Inserting one result per field is straightforward. However, when I select more than one option on the menu, Filemaker only accepts the inclusion of the first item.
What would be the best way to allow a user to select multiple options under the same field? How would I write the code?
Thanks,
Katarina
Comments
So how does it work, you have a list of items in a webpage and when you press a button you send the list away and create all the different files that were in the list.
Is this what you want to do, because it find your topic a bit unclear about it.
Be more specific please.
--=][tReShR][=--
I have a list of items in a field, and the user is allowed to select more than one by holding down the ctrl key while clicking.
After clicking submit, these options must be recorded/inserted into a FileMaker database.
Thus far, only checkboxes seem to be able to insert multiple options into a single field:
String MM_fieldsStr = "a|value|b|value|c|value|d|value|e|value";
String MM_columnsStr = "a|',none,''|b|',none,''|c|',none,''|a|',none,''|a|',none,''";
in which 3 of the checkboxes can be written to the field a.
However, I have 80 or so options for the user to choose - I don't think it would be too good of a layout to have 80 checkboxes on the screen.
What suggestions do you have?
Thanks,
Katarina
: [b][red]This message was edited by Moderator at 2003-10-16 0:56:53[/red][/b][hr]
: So how does it work, you have a list of items in a webpage and when you press a button you send the list away and create all the different files that were in the list.
: Is this what you want to do, because it find your topic a bit unclear about it.
: Be more specific please.
:
: --=][tReShR][=--
:
:
:
:
:
:
[b][red]This message was edited by Moderator at 2003-10-17 6:11:38[/red][/b][hr]
The first thing you have to use is a JavaBean, this is because you want to save multiple values at once and you maybe want to edit them.
There are 2 ways to do this. The first way is with a Vector and the second way is through the setter method and an array.
In the first way you would have to create a method that picks up all the values from the parameter from the list and sets them in a Vector one at the time. The advantage is that you would be able to edit them after you saved them in the array.
The second way is the fastest way and is like this. The JSP engine is that smart that when you create a setter method in the Javabean that accepts a String[] argument the engien will see the values from the list and will put tjem in the array right away. An ecample would be like this:
[code]
public void setListvalue(String [] listvalue) {
this.listvalue = listvalue;
}
[/code]
lisvalue would be the parameter name of the list in the JSP page. The JSP engine will create an array of all items with the name "lisvalue" and pass that array to the setter method.
Hope this helps you.
--=][tReShR][=--