Показать сообщение отдельно
  #3 (permalink)  
Старый 14.08.2009, 01:44
BoB BoB вне форума
Аспирант
Отправить личное сообщение для BoB Посмотреть профиль Найти все сообщения от BoB
 
Регистрация: 13.04.2009
Сообщений: 39

Я нашел скрипт

function createDOMForm(targetId, actionURL) {
 	parentElement = document.getElementById(targetId)
 	parentElement.innerHTML = ""
 	
 	myForm = document.createElement('FORM')
 	myForm.method = 'post'
 	myForm.action = actionURL
 	myForm.setAttribute('Name', 'myForm')
 	myForm.id = 'myForm'
 		
 	// Create a text field
 	textField = document.createElement('INPUT')
 	textField.type = 'text'
 	textField.setAttribute('value', 'text field')
 	textField.setAttribute('Name', 'myTextField')
 	textField.style.display = 'block'
 	myForm.appendChild(textField)
 	
 	// Create a textarea
 	textArea = document.createElement('TEXTAREA')
 	textArea.appendChild(document.createTextNode('text area'))
 	textArea.setAttribute('Name', 'myTextArea')
 	textArea.style.display = 'block'
 	myForm.appendChild(textArea) 
 	
 	// Create a submit button
 	newButton = document.createElement('INPUT')
 	newButton.type = 'submit'
 	newButton.setAttribute('Name', 'submit')
 	newButton.value = 'Submit'
 	newButton.style.display = 'block'
 	myForm.appendChild(newButton)
 	
 	// Place the form into the page
 	parentElement.appendChild(myForm)
 	
 	// Bit o IE bug fixin'
 	if(navigator.appVersion.indexOf("MSIE") != -1) {

    // Fixes the name issue, event handling, and rendering bugs!
 		 parentElement.innerHTML = parentElement.innerHTML

 
 		 if(navigator.appVersion.indexOf("MSIE 6.0") != -1) {
 			  multiOptions = document.getElementById('myDropDownMulti').options
 			  for(i=0; i<multiOptions.length; i++) {
 				   if(i==1 || i==3) { multiOptions[i].setAttribute('selected', 'true') }
 			  }
 		 }
 	}
}



Убрал ненужные формы, но добавить можно только один раз, и я не знаю отправиться это на почту или нет.
Ответить с цитированием