CMS Development

dennisedson
Equipe de Produto da HubSpot
Equipe de Produto da HubSpot

HubSpot form not rendering properly in IE 11

Hello friends. 

I have a form that does not want to play nice with IE.  i have an onFormReady parameter set for the form which is used to append a select and style the form.  Does anyone see anything in this code that would prevent it from working in IE?  works in all other browsers.  here is the page where the form lives

 

  	<!--[if lte IE 8]>
<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/v2-legacy.js"></script>
<![endif]-->
<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/v2.js"></script>
<script>
  hbspt.forms.create({
	portalId: "1747091",
	formId: "214e5ee1-94dd-4e2e-a448-8442bbb5e69f",
  onFormReady($form, ctx){
   		$("#position").appendTo(".form-columns-1");
		  $("#position").bind("change keyup", function(event){
	  	var positionValue = $("#position option:selected").val();
		  $('input[name=bdm_position]').val(positionValue).change(); 
  		});    
		  $('.hs_submit_resume input[type="file"]').change(function(e){
				var resumeName = e.target.files[0].name;
				alert('The file "' + resumeName +  '" has been selected.');
		    $('.hs_submit_resume label').attr('data-content', resumeName);
			});
    	$('.hs_submit_cover_letter input[type="file"]').change(function(e){
				var fileName = e.target.files[0].name;
				alert('The file "' + fileName +  '" has been selected.');
		    $('.hs_submit_cover_letter label').attr('data-content', fileName);
			});
		}  
	});
</script>

 

0 Avaliação positiva
2 Respostas 2
tjoyce
Especialista reconhecido(a) | Parceiro Elite
Especialista reconhecido(a) | Parceiro Elite

HubSpot form not rendering properly in IE 11

@dennisedson - I am noticing that you aren't referring to your form fields in the scope of the $form in your callback function. 'name="bdm_postion"' instead of 'name=bdm_position'. IE sometimes gets funny about little stuff like that.

 

$form.find('input[name="bdm_position"]').val(positionValue).change();
0 Avaliação positiva
dennisedson
Equipe de Produto da HubSpot
Equipe de Produto da HubSpot

HubSpot form not rendering properly in IE 11

@tjoyce, that did not work. 

I removed the script and replaced with a simple alert and the form still did not appear in IE.  The alert did pop up other browsers

0 Avaliação positiva