When a Webform with a pagebreak is being utilized as a block is it possible for the post-break continuation to occur on the form's node page rather than within the block?

In my testing it seems to only stay within the block.

In my case I have rather long form I want to sort of tease at within the block portion.

One idea I have would be to simply put the entire form in one page with the "Block fields" accepting URL parameters as defaults. Then create my own form as the desired teaser block that might feign a "Next Page >" button with some jquery to grab the field values and concatenate them onto the webform's url. Thus plugging them into the form after the break.

But I wanted to ask just in case I was missing something in the module that might save me the trouble.
Thanks for your input and thanks for Webform!

Comments

ecksley’s picture

I'm still interested to know if there is a better way, but for what it's worth I was able to get my work-around to work. Below is my code if anyone is interested. I'm not claiming it is well written.

In the block is form markup (mostly pulled from the original webform output). I replace the submit button with a div I can style as a submit button later:

<?php
<form accept-charset="UTF-8" id="webform-client-form-1"  class="webform-client-form">
	<div>
		<div id="webform-component-name" class="form-item webform-component webform-component-textfield">
			<label for="edit-submitted-name">Name <span title="This field is required." class="form-required">*</span></label>
			<input type="text" class="form-text required" maxlength="128" size="15" value="" name="teaser-name" id="edit-submitted-name">
		</div>
		<div id="webform-component-email" class="form-item webform-component webform-component-email">
			<label for="edit-submitted-email">Email <span title="This field is required." class="form-required">*</span></label>
			<input type="text" maxlength="128" size="15" value="" name="teaser-email" id="edit-submitted-email" class="email form-text required">
		</div>
	</div>
	
	<div id="edit-actions" class="form-actions form-wrapper">
		<!--<input type="submit" class="form-submit" value="Next Page &gt;" name="op" id="edit-next">-->
		<div id="teaser-submit">Next Page ></div>
	</div>
	
	</div>
</form>
?>

Also in the block is my jquery, which pulls the field values from above and concatenates them onto the proper webform's URL.

<?php
<script src="/sites/all/modules/jquery_update/replace/jquery/jquery.js"></script>

<script type="text/javascript">
// <![CDATA[
$(document).ready(function(){
	$("#teaser-submit").click(function(event){	
		var tname= $('[name=teaser-name]').val();
		var temail= $('[name=teaser-email]').val();
		window.location = '/webform-url-path?name='+tname+'&email='+temail;
	});
});

// ]]>
</script>
?>

As long as the defaults for the webform's name and email fields are %get[name] and %get[email] it will be passed the values from the teaser block.

I suppose I could also add some validation to my jquery as well if I wanted to insure required fields are populated before advancing.

quicksketch’s picture

Status: Active » Closed (duplicate)
quicksketch’s picture

Issue summary: View changes

Fixed Typos