function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
jmojmo 

HTML Link passing values to Web To Case

We are using an email template to send out an email that includes a link to a web to case form on our public website.  We are passing variables/values with this link and would like the values to be prepopulated in our web to case form.  Some of which we would like hidden.  We can not get the values to prepopulate the web to case fields.  For example, passing case # on the url.  What should the HTML code look like to receive these?  Do we need to parse the URL first?
 
For example:
 
HTML Web to Case Form
<input type="hidden" name="00N30000000i2oN" value="we want this to be the passed case number">
 
Help!!!   thanks in advance.....
hemmhemm
I am not sure of a slick way to do it right in HTML, but you can do it with scripting.  Someone might have a Javascript example, but I can show you in PHP.  If you use PHP, you can grab values from the URL, put them into variables and then use that variable when writing out the HTML.

Suppose you had a URL like http://publicsite.com/survey.html?caseNum=060706-0053 and you are trying to grab the value from the caseNum parameter.  In PHP, you could say:
<?php
    if (isset($_GET['caseNum'])){
        $CaseNumber = $_GET['caseNum'];
    }
?>

Then when writing out your HTML, do something like:
<input type="hidden" name="00N30000000i2oN" value= <?php $CaseNumber ?> >
That's the general idea.  If your web server is UNIX based, it probably supports PHP.  This doesn't require the Salesforce PHP toolkit or anything fancy like that.  All it is it using a PHP file instead of an HTML file and having a few pieces of script in there.


If you don't know whether your server supports PHP, create a new textfile called phpinfo.php and put the following line of code in there:  <?php phpinfo(); ?>
Then upload that file and run it in your browser.  You should get a page explaining your PHP configuration on that web server.  If you don't get anything back or get an error, then your server doesn't support PHP and you could look for a way to do it in Javascript or another scripting language.

Good luck.

jimjamzjimjamz
*bump*

Does anybody have a Javascript example???