Pre fill contact form on same page

1 reply · opened Jan 16, 2017

ZzvrzvrJan 16, 2017

Hello,

is there any way to pre fill form on same page (different section)?

[Don't Die for Love](#template-contactform-subjecte)

The idea is that when person clicks on this type of product for inquiry subject will be filed with product name. Is that even possible on same page just with html?

Thank you very much!

SSemicolon WebSTAFFJan 20, 2017

Hello,

This should be definitely possible but using jQuery! Consider following the Steps below:

  1. Add the .value-setter Class to the <a> Tag.

  2. Add the data-value="Your Value" Attribute instead of using the value Attribute since and then use the data-target="#template-contactform-subjecte" Attribute instead of using the href Attribute.

  3. Then add the following JS Code at the bottom of the Page just after the js/functions.js JS File Linking:


	jQuery(document).ready( function(){
		jQuery('.value-setter').on( 'click', function(){
			var element = jQuery(this);

			jQuery( element.attr('data-target') ).val( element.attr('data-value') )

			return false;
		});
	});

This will definitely work fine. Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

Have the same question, or something new?

Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.

Reply on the dashboard