Jump to content
Server Maintenance This Week. ×

conditional value lists & other


This topic is 8032 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies

I have created this great chemical inventory database...now I want to put it on the web to allow my people to update their inventory by internet.

I am using HTML & CDML along with Custom Web Publishing to try to get my database on the web.

I am having problems with creating the pages to allow adding a record to the database. My problem is that I want to use conditional value lists that I have in FM Pro, but is there a way to recognize a value inputted in one field, to choice the correct value list for another field....without submitting the new record to the database? or do I have to submit, than use an edit form?

The other problem I have is that for one of my fields, I want to use a value list that allows you to enter a different value than those listed in the value list. Can I do this? DO I need two fields....one that is a popup menu that they can select from if they want (field 1) and another that they can enter their own values (field 2).....if so how do I get the correct value submitted into the database...is a script and another field needed (field 3)...

such as :

if field 1 = "no selection"

set field 3 = field 2

else field 3 = field 1

Am I missing a key point to understanding how to accomplish these?

Link to comment
Share on other sites

  • 4 months later...
  • Newbies

Minmin,

Once the html page have been generated and is visible in the browser it must, in order to change, either send a request to the database, or contain already all the required information. The only solution, if you don't want to submit, would be to send in the initial page the totality of the data and dynamically populate your value lists (using javascript) when some text is entered in the field. This can be a tough job, however, and the initial html page can get very big if there is a lot of data. I suggest you let the server do it for you by submitting your form.

The second point is much easier: you need two fields in the form for each field in the database. The first one will be a text field named after the database field. The second one will be a popup menu with no name (this is important), populated with your value list. A very simple javascript will copy the selected value from the popup into the text field.

Example ???

<form action="FMPro" method=post name=fp><!-- a name is required for the javascript to work-->

<!-- the text field's name is the name of the database field -->

<Input type=text name=dbfieldname size=20 value="[FMP-Field:dbfieldname]">

<!--

the select has no name, this is intented

the first item in the menu does nothing

each time a value is selected in the menu, the corresponding value is copied in the text field

then the menu selection is set back to the first item

-->

<Select onchange="document.fp.dbfieldname.value=this[this.selectedIndex].value; this.selectedIndex=0;">

<option value=""> - Choose a value -[FMP-ValueList: dbfieldname, List=valuelistname]

<option value="[FMP-ValueListItem]">[FMP-ValueListItem][/FMP-ValueList]

</Select>

</form>

Hope this helps,

Theo

Link to comment
Share on other sites

This topic is 8032 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.