+ Start a Discussion
Amita TatarAmita Tatar 

populating date field through URL in VF page

Hi all,

I have a standard date field in VF page. When i redirect to this URL i want to pass the date through the URL and set date as default value. How to do that. Please help

Uvais KomathUvais Komath


Its called URL hacking. 

Inspect the page (Right click on page > Inspect)

Find id of the input field 

Then add the following in your URL

&<Field ID HERE>={!Object.DatefieldName}

Amita TatarAmita Tatar
Hi Uvais,

But how do i put there today's date?
Uvais KomathUvais Komath
Use {!$System.Today()} instead of {!Object.DatefieldName}
Vivek DVivek D

Try this
// In Javascript
var myDateParameter = '{!$currentpage.parameters.circularno}';

var s = document.getElementById('{!$Component.myInputFieldId}');
 s.value = myDateParameter ;