January 27, 200322 yr Hi Everyone! I'm back again with more goodies! Scinario: I'm creating a pop-up window for searching within' a database. I've managed to create the following: Field Name Selection (drop down list) Search Operation (drop down list) Text Field for data to be found. JavaScript: function show(field1,dummy1){ var selected1= field1.selectedIndex; var fname1 = field1.options[selected1].text; document.find[fname1].value=dummy1.value; document.find.submit();} HTML: <a href="#" onClick="show(document.find.field1,document.find.dummy1);">Start Search</a> <form action="FMPro" method="post" name="find"> <input type="hidden" name="-DB" value="[FMP-CurrentDatabase]"> <input type="hidden" name="-format" value="layout1.html"> <input type="hidden" name="-lay" value="layout1"> <input type="hidden" name="-find"> <table border="1"> <tr> <td> Field: <select name="field1"> <option></option> [FMP-LayoutFields] <option>[FMP-FieldName]</option> [/FMP-LayoutFields] </select> <select name="-Op"> <option value="bw">Begins With</option> <option value="neq">Omit</option> <option value="eq">Exact</option> <option value="cn">Contains</option> <option value="ew">ends with</option> <option value="gt">greater than</option> <option value="lt">less than</option> </select> [FMP-LayoutFields] <input type="hidden" name="[FMP-FieldName]" value=""> [/FMP-LayoutFields] <input type="text" name="dummy1" value=""> </td> </tr> </table> </form> PROBLEM: This works when there is only 1 set (field name, operator, data). I've taken the exact code (JavaScript & HTML) and duplicated it with new names. In theory that should work but I keep getting the "Record Not Found" error, but I'm looking at the database as it's processing, and it doesn't even process the find in the database. It does when there's only 1 set though. Am I attacking this correctly? Thanks! ~Addam~
January 28, 200322 yr Addam, Are you able to check on the database to see "Modify Last Find"? Or, isn't it even getting to that stage? I guess you have "Field1" and "Dummy1" as fields on your Layout. Another thought is that each additional set is treated as a "AND". Good Luck. Garry
January 29, 200322 yr Author Thanks for thet reply Garry! To answer your question, it's not even getting to that stage. It seems to blow-up before it get's to the database. Field1 & Dummy1 are 1 in the same. JavaScript is going to take the Field1 value and set it to the name of the one that has "[FMP-FieldName]" as the name. Then it uses the Dummy1 value and places it into the same "[FMP-FieldName]" value. That is the only one that get's processed. I think the other fields that didn't mean anything are the ones that were causing to cause the form not to work. So I steped back and took another look. Since this will be a pop-up window, all I really need is to grab information then send it back to the original document for processing. Instead of adding another form to process on the main document (the same form I couldn't get to work), I just used the information gathered in the pop-up and used JavaScript to generate a new URL for the main document with the search information in it. Since there's only 4 options, it's not that bad. It seems to work so far. I'll post it up once it's been fully developed just incase anyone would ever need it. Thanks again for the reply! Cheers! ~Addam~
Create an account or sign in to comment