Pre-filling Form Fields

Kurt Hansen -

You can pre-fill text fields and pre-select drop-downs or radio groups by passing a key=value pair to a ChairtyWeb form. Here is an example by including the key=value pairs in the URL, aka as a parameter list:

https://ssl.charityweb.net/cwdemo/?FirstName=Test;LastName=Donor;DonorIntent=Scholarship%20Fund;TotalAmt=43;Source=Radio

The "key" must be the name of the field you want to pre-select, such as FirstName. Note that they key is case sensitive. The value is also case sensitive it is in a radio group or drop-down.

A list of the possible field names can be found here:

https://www.charityweb.net/resources/fieldlist.htm

You can also determine the keys and values by inspecting the html source. Both Mozilla Firefox and Google Chrome have excellent tools for inspecting the code of a web page. If you right click over a page, a pop-up appears. Choose "Inspect Element" to view the code.

This key=value trick also works if you want to post values to the CharityWeb form instead of including it in the URL. You would use this if you have a signup form on your site but want to pass the information to CharityWeb.

Sometimes, the value you want to pass has spaces or other non-alphanumeric characters. These need to be URL encoded. For spaces, that is using %20 instead. Replace apostrophes with %27. Here is a useful tool for encoding a string: http://meyerweb.com/eric/tools/dencoder/

 

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.
Powered by Zendesk