• 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 exclude some field from submit? HELP!!!

How can I exclude some field from submit? HELP!!! 16 years 4 weeks ago #6936

  • mark75to
  • mark75to's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 3
Hi, I want to use RSForm!Pro for create something like "LegalNotice", so I have two fields.
One field for text-area field in readonly with LegalNotice and One field for checkbox to LegalNotice agreement. Now I want to submit only Agreement field and not a Text-area with LegalNotice because it is saved in Database and it use space.
How can I do it? Is possible to exclude some field from submit?
Sotty for my bad english. I hope that you have understood my post....

Thanks a lot.
Last Edit: 16 years 4 weeks ago by mark75to.
The administrator has disabled public write access.

Re:How can I exclude some field from submit? HELP!!! 16 years 4 weeks ago #6956

  • s31523
  • s31523's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 25
Not sure if there is a "cleaner" way, but I have something similar and here is the gist of what I did.

I have a master form with lets say 7 fields on it. After a submit I want the 5 fields and not the 2. I actually create a new database entry on the submit and store the 5 fields in as a new form. The code for this is all manual and not straight forward, but it all goes in the code for processing on the applicable tab.

I can post some of my code if you want. Maybe there is a better way, as I am sure there is and I probably did a little overkill...
The administrator has disabled public write access.

Re:How can I exclude some field from submit? HELP!!! 16 years 3 weeks ago #6972

  • mark75to
  • mark75to's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 3
Hi s31523, thanks a lot for your feedback. If you can please post your code... so I can try to modify it for me.
The best way is if RSForm integret option for exclude field in next update....but if your solution works I will use it.
Thanks a lot.
The administrator has disabled public write access.

Re:How can I exclude some field from submit? HELP!!! 16 years 3 weeks ago #6976

  • s31523
  • s31523's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 25
Agreed, that would be a nice option to have!

I do not have exactly what you are looking for as an example, but if you are familiar with PHP and how the RSForms are stored you should get the jist

FYI: I am using RSForm, not RDForm pro. There may be some differences in table names, table format, etc...

Here is a snippet of my "script called on form process".

The gist of what I am doing is this: I have a report form where I manually created several entries that represent restaurants. Each restaurant has a monthly food special. I created a form that allows the manager to set the special. The form that sets the special is a "dummy" form, that is I do not want to store a table of all specials ever submitted, I just want the special to be copied to the other form with the restaurants in it an overwrite the special name for each restaurant. So when the user enters the special name, and clicks submit I make sure I delete any data in the "dummy" form and then use the data submitted to overwrite all specials for each restaurant in my other form.
// Delete any current data elements in THIS table since I only want to store the values
// from this submit in another form.
$database->setQuery("DELETE FROM jos_forme_data WHERE form_id=5" );
$database->query(); 
 
 
// Only process when my field of interest is set and the submit button was pressed.
if(isset($_POST['form']['specialName'])) {
$specialNameValue=$_POST['form']['specialName'];
 
 
 
// Setup database access to existing table that I will store the field from this submit in.
$database->setQuery("SELECT id as mykey, form_id as formid, params as formData FROM jos_forme_data WHERE form_id =4" );
$allFormEntries = $database->loadObjectList();
 
 
// loop through all table entries in the table I want to store the value from this submit
// 
// Loop Post Condition:
//   All fields in target table will be set to the one field from this submit.
foreach($allFormEntries as $anEntry){
 
  // use a regular expression search and replace
  // We will look for the fieldname and its value and replace
  // the value with the one from this form.
$newFormData=preg_replace ("/special=.*\|\|/", "special=$specialNameValue||",$anEntry->formData);
 
  // Now we will replace the old form data in the database table
  // with the new form data.
  //  This updates the special name with the new name for all
  //  restaurants.
  $database->setQuery("UPDATE jos_forme_data SET params='$newFormData' WHERE id=$anEntry->mykey ");
 
  $database->query(); 
}
 
 
} // check for submission



You could do something similar, except you could build a full entry into the jod_forme_data table (or whatever it is called on your system) and then just insert it into the table. You can pick and choose the fields you want to build.

Hope this helps!
The administrator has disabled public write access.

Re:How can I exclude some field from submit? HELP!!! 16 years 3 weeks ago #6989

  • s31523
  • s31523's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 25
Actually, I was thinking... For your example why even bother? In the static content page you create you can simply type the legal notice out and then trigger the form display below it.. I.e.

Legal Notice:

I agreee to something something. By checking the box and clicking submit you agree to the terms blah blah

{mosforme #}
The administrator has disabled public write access.

Re:How can I exclude some field from submit? HELP!!! 16 years 3 weeks ago #7009

  • mark75to
  • mark75to's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 3
Hi, Thanks a lot very much. Your idea is very good. In this way I have resolved my problem :laugh:
Very very thanks a lot!!! You are great!!! You saved me :)
Ciao
Marco
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!