The following warnings occurred: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
|
1 Form 2 Databases - Printable Version +- Form Tools (https://forums.formtools.org) +-- Forum: Form Tools (https://forums.formtools.org/forumdisplay.php?fid=1) +--- Forum: General Discussion (https://forums.formtools.org/forumdisplay.php?fid=5) +--- Thread: 1 Form 2 Databases (/showthread.php?tid=711) |
1 Form 2 Databases - vizzaroo - May 24th, 2010 * EDIT just realised I've posted this in the General Discussion and not the API forum. (FT is API installed) Hi Ben, Need to rely on your wizzardry again lol Currently at work so apologies if this has already been asked as I don't have time to use the search function. Posting this quickly, hoping to have a reply when I return home later . Question: I've currently set up to two forms. ID's are (1 & 2). 1 = Banks / 2 = Buildings. On the html form i've created there is a drop down which has the options Bank / Buildings. I know the way to have the form submit to one database and use filter views based upon the drop down values, but I was wondering if you can define which database the submission gets sent to based upon the option selected in the dropdown ? So if the users selects Buildings (2) - the submission is sent to FORM 2 rather than FORM 1 Hope that makes sense. Cheers Vizz RE: 1 Form 2 Databases - iroast - May 24th, 2010 Why not keep it simple? 2 forms / 2 dbs. Link Banks to Form 1 and Buildings to Form 2? You wouldn't need that drop-down menu if you do it this way. RE: 1 Form 2 Databases - vizzaroo - May 25th, 2010 (May 24th, 2010, 9:21 AM)iroast Wrote: Why not keep it simple? 2 forms / 2 dbs. Link Banks to Form 1 and Buildings to Form 2? You wouldn't need that drop-down menu if you do it this way. Thanks for the input, but generally the user filling out the form will not know which dropdown option to select untill they fill the previous fields as the coding that is scripted for the html form itself only presents the drop down options based on the users selections and input in the previous fields. So having the html form point to just 1 database and filtering the submissions is the easiest way as I've already done but was just curious as to any possibility to have the array which determines which database form it sends the submission too based on the drop down selection. Also. To ask if I may @ Ben When creating a specific view with filters, I have a view that I want to display total submissions made "Today". I created the filter with the field option as 'Date' , selected Today's date in the After / Before. Which works fine. Trouble is I have alot of views with other various filters that include Today's Date, that I have to manually go into and change the date range to Today's date. Is there a way that I've overlooked or can incorporate the portal to automatically update the view / filter to today's date or do I need continuously change each view's date range manually ? RE: 1 Form 2 Databases - Ben - May 27th, 2010 Hi Vizzarroo, Sure! Assuming your Banks and Buildings table have form IDs of 1 and 2, respectively, you could just make your dropdown something like this: Code: <select name="form_tools_form_id"> Then remove the hidden "form_tools_form_id" field. That will then submit the content to the appropriate database table. Ooh... unless this is an API form. Is it? Uh-oh. Bet it is. Quote:Is there a way that I've overlooked or can incorporate the portal to automatically update the view / filter to today's date or do I need continuously change each view's date range manually ? Ah, I'm afraid I only have bad news... Right now there's no way to update multiple Views at the same time. In order to get each View to only show the last day, you WILL need to edit every one of them. I know this is a pain, so I'll definitely be adding "View Groups" at some point to let you reduce the amount of customization. Sorry about that, Vizzarroo. - Ben RE: 1 Form 2 Databases - vizzaroo - Jun 1st, 2010 (May 27th, 2010, 8:35 PM)Ben Wrote: Ooh... unless this is an API form. Is it? Uh-oh. Bet it is. Yeah it's API installed. Thanks for the info Ben, no problem would be useful as it would reduce some administration but not a major concern at this point. Your doing a great job. RE: 1 Form 2 Databases - martine4161 - Jun 1st, 2010 You can do this very easily. For that you just have to change the value of submit query. In the statement insert values , you can make the condition that if the form value is building then the data will be stored at building table and if the form value is bank then you can stored it in the bank. This one change can solve your problem. |