I have a code that is going to pick the page title of the previous page and autopopulate a field in a form i have created.
Users pick the job they want then upon clicking apply the go to an application form. There is a field that is being autopopulated with the title of the job page which is the previous page.
The thing if the user goes to a different job page then onto the application form page, the field to be autopopulated doesnt get populated with the right title, it still remembers the other title.

The auto pick code works well, can i get help in the code that makes the application page forget any previously entered titles.

Here is the code snippet

<?php
function awi_autopopulate_workshop_title( $value ){
   $referer_id = url_to_postid( wp_get_referer() );
   $workshop_title = get_the_title( $referer_id );
   return $workshop_title;
}
add_filter( 'gform_field_value_workshop_title', 'awi_autopopulate_workshop_title' );
?>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.