Jump to content

Error when using Form in Blogspot

Recommended Posts

Hi guys, I am having problems using dynamic data list, It doesn't work when I insert a form into Blogspot, how should I fix it?
<body contenteditable="false">
function populate(Ts7, Ts8){
	var Ts7 = document.getElementById(Ts7);
	var Ts8 = document.getElementById(Ts8);
	Ts8.innerHTML = "";
	if(Ts7.value == "Phòng kế hoạch"){
		var optionArray = ["|","|Phòng kế hoạch"];
	} else if(Ts7.value == "Bản"){
		var optionArray = ["|","|Bản1","|Bản2","|Bản3"];
	} else if(Ts7.value == "Huyện"){
		var optionArray = ["|","|Huyện1","|Huyện2"];
	} else if(Ts7.value == "Tỉnh"){
		var optionArray = ["|","|Tỉnh1","|Tỉnh2"]; 
	} else if(Ts7.value == "Trung ương"){
		var optionArray = ["|","|Trung ương1","|Trung ương2"];         
	for(var option in optionArray){
		var pair = optionArray[option].split("|");
		var newOption = document.createElement("option");
		newOption.value = pair[0];
		newOption.innerHTML = pair[1];
<p>1. Cấp</p>
<select name="entry.694698089" id="Ts7" required="" onchange="populate(this.id,'Ts8')">
<option value="">Chọn</option>
<option value="Phòng kế hoạch">Phòng kế hoạch</option>
<option value="Bản">Bản</option>
<option value="Huyện">Huyện</option>
<option value="Tỉnh">Tỉnh</option>
<option value="Trung ương">Trung ương</option>
<p>2. Nội dung</p>
<select id="Ts8" name="entry.1049020395" required=""></select>


Link to post
Share on other sites

My first guess is that BlogSpot removes <script> tags from the content of the document.

If that is not the cause of the problem, then maybe there is a Javascript error. In most browsers you can see Javascript errors by pressing F12.

  • Thanks 1
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...