Jim,
Hi. Great idea, I am sure there is a way to do this but its going to involve a little more work than simply checking a box within the modules settings etc... We have had another client implement something similar though so I am sure it can be done. If we do discover a way to later add this as a feature we might implement it as a client side event where a checkbox can appear that simply allows you to use it as a 'copy' field checkbox and you select which fields to copy to/from if they check or uncheck the box.
For right now this is what you can do. Ill try and get an example posted but here are the basics (ready for the fun ride? ).
1. Create all of your registration fields first.
2. Once you are complete you will want to add an example text to a field or an HTML field type that includes an HTML checkbox. Keep in mind that example text can include HTML so you just need to decide where you want the checkbox.
The HTML would look something like this (add < and > before and after line below, I couldn't insert it directly into the forum because it actually appears as a checkbox.:
input type="checkbox" onclick:"javascript(CopyFields();" name="checkbox" value="checkbox"
3. Modify a file within your Dynamic Registration ascx file. This file is located under:
DNNDirectory\DesktopModules\Dynamic Registration and is called DynamicRegistration.ascx. Make a backup of the file first to make sure you have it.
4. Initially, just add some sample javascript code within the file to make sure the checkbox field you added above is firing. Something like this:
5. Next actually test that its working. I didn't verify this javascript code or anything but its pretty basic. Just add that script tag towards the top of the .ascx file you are modifying.
6. After you get this far here is what you would do next:
1. Determine the field names from step 1 (both the field from and the field to) that you wish to copy. I would test with just one field at a time while you get the code to work. For example, if the first field is called 'Address 1' then go to your registration page and click View Source. Do a search for Address 1. Within that you should see the textbox ID. Each textbox/field has its own unique ID. You just need to fine the ID's for the textbox fields you want to copy from and to. I would start with just the first one to make sure you have it right. The ID is going to look something like this:
"dnn_ctr469_DynamicRegistration_Responses_f976d909-1a8c-4c6b-a104-e30341fb1546"
7. Finally change your javascript function to copy from field 1 to field 2 (maybe even alert you of field 1 value to make sure you have the correct value).
So, for example the code would look like this:
Alert(document.getElementById('dnn_ctr469_DynamicRegistration_Responses_f976d909-1a8c-4c6b-a104-e30341fb1546').value)
That would provide you with the value of the field in an alert textbox. To copy it you would have something like this:
document.getElementById('dnn_ctr469_DynamicRegistration_Responses_f976d909-1a8c-4c6b-a104-e30341fb1546').value = document.getElementById('dnn_ctr469_DynamicRegistration_Responses_f976d909-1a8c-4c6b-a104-e305555555').value
Above example is assuming Address 1 (original) fieldID is:
dnn_ctr469_DynamicRegistration_Responses_f976d909-1a8c-4c6b-a104-e30341fb1546
and Address2 fieldID (new field) is:
dnn_ctr469_DynamicRegistration_Responses_f976d909-1a8c-4c6b-a104-e305555555
Thats the basics. Not sure how familiar you are with javascript but if you break down what you are doing its pretty simple. Just getting the right ID's might be troublesome because you have to view source and get them etc... When it comes down to the actual code its really only a few lines to copy from one to the other. You could get fancy with the Javascript though to check if the checkbox is unchecked it would clear all of the fields out and so forth.
Hope you can find this useful.
-Chad