How To Pre-Populate A Form Field In A PopUp Form?

  • Joe Bloggs
  • Newbie
  • Newbie
  • Joe Bloggs
  • Posts: 7

Post 3+ Months Ago

Hello Folks

I’m running a simple cms application on my website that allows users to add their products. Each product has a unique reference number.

I have also used: easyphpcontactform . com as a contact form. I use a simple Javascript so it pops up in a new window.

What I would like to do is add a new form for each product. The idea being that when the user wants more info on a particular product - they click a link which pops-up a form. The form needs to be pre-populated with the product reference number.

I can’t work out how to get the popup to have a pre-populated field with the ref num contained on the product page... any help much appreciated.

Thanks
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • zbrdlowski
  • Beginner
  • Beginner
  • User avatar
  • Posts: 35
  • Loc: Trencin - Slovakia / Europe

Post 3+ Months Ago

I suppose you need to put informations that user filled up in prevoius form. So put all those required values to the $_SESSION variables and then you just put them into fields.:

Code: [ Select ]
print '<input type="text" name="blah_blah" value="'.$_SESSION['blah_blah'].'">';


of course you need session running on that page
Code: [ Select ]

session_name ('name');
@session_start();
  1. session_name ('name');
  2. @session_start();


After submitting the form you can unset those $_SESSION variables

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: wpas and 72 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.