Update Form using the Form Generator plugin

By Twocans - February 2, 2017

Hi yea,
The form Generator plugin is all working well at creating forms, have you any idea as to when one will be able to update forms, as I don't have much use for it with only the option of inputting.

I understand you do not want to commit yourselves but even if you had a ballpark date is better than nothing.

I am aware you guys do private work but I do not want to go that direction, I just like to have an understanding as to when I can actually make use of the this great plugin.

cheers

kenny

By ross - February 2, 2017

Hi Kenny

Thanks for posting.

The current version of Form Generator supports "edit" forms already.

Keep in mind that it's an advanced feature and requires some extra work beyond the basics of the code generator.

To get started, when you are in the code generator, make sure you check off the option for "Allow editing existing records (advanced feature)".

From there, copy and paste the code as you have been and get your basic input form setup.

By default, the form is always an "add" form. Let's say your form is called "myForm.php".

To change your form into an "edit" form, you need to use this URL: "myForm.php?num=123".

Just change the number at the end to match one of your existing record numbers.

Does that make sense?

I recommend starting with just this part.  Let me know how you make out.

-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com

Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/

By Twocans - February 2, 2017

Yes Ross 
I understand it allows update using the num aka myForm.php?num=123

But when checking the "Allow editing existing records (advanced feature)"

and checking the "Require users to be logged in (requires Website Membership plugin)"

it does not give me the option of filtering by current user

 'createdByUserNum' => (int) @$CURRENT_USER['num'],

Regards

Kenny

By ross - February 2, 2017

Hi Kenny

Great. You've seen the options.

And what you are also finding is that hooking up Website Membership to Form Generator is going to require some manual coding.

Do you have an idea of how to set that up?

Get it as far as you can and let me know where you end up.  We can discuss it further once you get there.

Keep me up to date with how you are making out.

Thanks!

-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com

Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/

By Twocans - February 6, 2017 - edited: February 6, 2017

Thank you Ross,

I believe this is what I was needing. I left the other two commented out lines for others (and myself) in the future

// 'where' => 'createdByUserNum = '. mysql_escape($_REQUEST['num']), //filtered by whatever is passed in the url aka ?mypage.php?num=123
//'where' => "`createdByUserNum` = '222'", // filtered by what ever you enter in between the '' where the 222 is
'where' => whereRecordNumberInUrl(1). " AND createdByUserNum= '". $CURRENT_USER['num'] ."'", // filters by current user

The above filters the recordset by the current_user logged in.

If I made any error I would be more than grateful for any input.

regards

kenny

By ross - February 7, 2017

Hi Kenny

That sounds ok to me.  I don't have a complete picture of your setup so there could be adjustments possible.

Is your current setup working for you?

If everything is working, I think you can just keep moving forward.

Let me know any questions.

Thanks!

-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com

Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/