Peter Knowles Posted November 4, 2005 Posted November 4, 2005 I'm looking for a way to format an editable new record reply page to make sure that the user edits made there conform to the contents in each database field. Here's what I mean: When users make a new record online in a calendar database, several fields use drop down value lists to constrain their responses. For example, there are three schools in our district, and users can select one of them as the location for a school activity. When users submit an event to the db, they get an editable record_reply form, including their posted choices, returned as text fields filled with [FMP-FIELD] contents. Now, if they want to change one of their field replies, they are faced with a text field (instead of the original drop down value list). So, instead of having only three choices for those schools, they could type a completely different word, mispell a word, use initials or abbreviations, or add "high school" or other words to the field. When they then submit the edit, they will have created field contents that do not match the three choices in the value list. Since db calculations depend on the contents of some of these fields, I (think) I need to make sure that only the three options offered in the original new record form are used in the edit as well. I've been playing with some sort of way to use a pre-selected drop down list on the new record reply form, so the user still only has the original choices, with their initial selection shown, but my efforts have been very cumbersome to code and don't seem to work right. Any ideas? Or am I better off simply returning a static/non-editable new record reply, and having users resubmit if they need to make changes. (That seems like it could be a lot of work to fill forms in duplicate, and get rid of duplicate records.) Stumped, for now.
Garry Claridge Posted November 5, 2005 Posted November 5, 2005 You can still use a drop-down for your record_reply page. If the drop-down is generated by a ValueList you can use the [FMP-ValueList] tags to display the selected item. If it is not generated by a ValueList you can use some Javascript to select the correct option. Good Luck. Garry
Peter Knowles Posted November 5, 2005 Author Posted November 5, 2005 Thanks, Garry. Can you point me to a reference for doing this, or give me an idea of what the code would look like? I haven't been using the [FMP-Valuelist] tags, but could easily switch. If I do it that way, what would the source code look like to return the user's initial choice in a Field called "school", where there are four options (A, B, C, & D...or does that even matter if I'm using the valuelist tag?) I've got my "FileMakers Bible" at work, so can't consult that right now, but will delve into the ValueList options when I do. If you have any other ideas.....? Thanks, Peter
Garry Claridge Posted November 6, 2005 Posted November 6, 2005 For an HTML Select, with an FM ValueList, you can try this: Country: [FMP-ValueList: Countries, List=Countries] if ( myglobal == "[FMP-ValueListItem]") { document.write('[FMP-ValueListItem]'); } else { document.write('[FMP-ValueListItem]'); }; [/FMP-ValueList] Else, try this: Country: if ( myglobal == "A") { document.write('A'); } else { document.write('A'); }; if ( myglobal == "B") { document.write('B'); } else { document.write('B'); }; if ( myglobal == "C") { document.write('C'); } else { document.write('C'); }; if ( myglobal == "D") { document.write('D'); } else { document.write('D'); }; All the best. Garry
Recommended Posts
This topic is 6949 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 accountSign in
Already have an account? Sign in here.
Sign In Now