• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: How can I use modify with mappings?

How can I use modify with mappings? 11 years 10 months ago #23666

  • anthony.burge
  • anthony.burge's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 16
  • Thank you received: 3
Details
I have a form that is using mappings. If the form is being filled out for the first time, I'd like to insert the data into the database.
If it has previously been filled out (by the current user), I'd like the entry to be updated.

Question
Is there a way to do this with RSform!Pro? I don't mind hacking the component if I need to.

My thoughts so far
I thought that perhaps I could use 2 forms- both identical except that one form inserts and the other one updates. To do this though, I would need to determine if the current user has filled the form out before and then provide a link to the appropriate form. Since the link will be shown via another component, I'm not sure that this will be a viable option.

I'd appreciate any thoughts on this issue.
Last Edit: 11 years 10 months ago by anthony.burge.
The administrator has disabled public write access.

How can I use modify with mappings? 11 years 10 months ago #23679

  • anthony.burge
  • anthony.burge's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 16
  • Thank you received: 3
I haven't tried it yet, but I think I may have found a possible solution thanks to this post
http://www.rsjoomla.com/forum/37-rsform-pro/19516-ajax-form-submit.html#19516
The information at http://www.malsup.com/jquery/form/#options-object was also very helpful.

Solution?
It's a bit of overkill but I think I override the submit buttons normal action and post the data to a php script (using url). Then I need to write my own DB handling functions into the php script to (1)check whether the form has previously been submitted (2)to insert/update the DB as appropriate.

This would mean that I don't use mappings at all as the php script I send the data to will do all of that.
Last Edit: 11 years 10 months ago by anthony.burge.
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!