Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

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

Featured Replies

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: http://www.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

Pre-populating a form input box is done by add the value="..." into the input tag or text into a textarea.

<li><input type="checkbox" name="Extras" value="Photos">Photographs</li>

<li><textarea name="comment" rows="6" cols="40">Type your message here></textarea></li>

The viewer can change this.

 

If you have separate forms, that will probably be enough, but you can have chained selects which alter the select box items (values) depending on which item was selected in the previous select box.

http://www.dynamicdrive.com/dynamicindex16/chainedselects/index.htm (it needs javascript/ActiveX).

  • Author

Pre-populating a form input box is done by add the value="..." into the input tag or text into a textarea.

<li><input type="checkbox" name="Extras" value="Photos">Photographs</li>

<li><textarea name="comment" rows="6" cols="40">Type your message here></textarea></li>

The viewer can change this.

 

If you have separate forms, that will probably be enough, but you can have chained selects which alter the select box items (values) depending on which item was selected in the previous select box.

http://www.dynamicdrive.com/dynamicindex16/chainedselects/index.htm (it needs javascript/ActiveX).

 

 

Thanks

 

What I don’t understand is how I make the popup form - take the data from the page it is loaded from.

 

1. User sees an item - user wants more info.

2. User clicks more info link.

3. Form pops up with reference number of item already in it.

4. User completes form with contact details.

5. Clicks submit

 

Seller receives form in email - with reference number and is able to quickly know which product enquiry is about.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.