Jump to content

shprot

Neophyte
  • Posts

    1
  • Joined

  • Last visited

Everything posted by shprot

  1. Здравствуйте. Задача простая, по событию нажатия кнопки нужно что бы заполнялось поле text. Код используется в сайте google, почему то при нажатии кнопки происходит открытие новой вкладки,что я не так делаю? Возможно что-то не так с action..Заранее спасибо. [color=#009900][size=3][background=rgb(244, 244, 244)]<[/background][/size][/color][color=#000000][size=3][b][background=rgb(244, 244, 244)]html[/background][/b][/size][/color][color=#009900][size=3][background=rgb(244, 244, 244)]>[/background][/size][/color] [color=#009900]<[color=#000000][b]HEAD[/b][/color]>[/color] [color=#009900]<[color=#000000][b]script[/b][/color] [color=#000066]language[/color][color=#66CC66]=[/color][color=#FF0000]"Javascript"[/color]>[/color] function but1() { document.getElementById("pole").value = "data"} [color=#009900]<[color=#66CC66]/[/color][color=#000000][b]script[/b][/color]>[/color] [color=#009900]<[color=#66CC66]/[/color][color=#000000][b]HEAD[/b][/color]>[/color] [color=#009900]<[color=#000000][b]body[/b][/color]>[/color] [color=#009900]<[color=#000000][b]form[/b][/color] [color=#000066]action[/color][color=#66CC66]=[/color][color=#FF0000]"https://sites.google.com/site/softhvac/Quick-calculation-in-tables-google"[/color]>[/color] [color=#009900]<[color=#000000][b]input[/b][/color] [color=#000066]id[/color][color=#66CC66]=[/color][color=#FF0000]"pole"[/color] [color=#000066]type[/color][color=#66CC66]=[/color][color=#FF0000]"text"[/color] [color=#000066]name[/color][color=#66CC66]=[/color][color=#FF0000]"name1"[/color]>[/color] [color=#009900]<[color=#000000][b]input[/b][/color] [color=#000066]type[/color][color=#66CC66]=[/color][color=#FF0000]"submit"[/color] [color=#000066]name[/color][color=#66CC66]=[/color][color=#FF0000]"name"[/color] [color=#000066]value[/color][color=#66CC66]=[/color][color=#FF0000]"Кнопка"[/color] [color=#000066]onclick[/color][color=#66CC66]=[/color][color=#FF0000]"but1()"[/color]>[/color] [color=#009900]<[color=#66CC66]/[/color][color=#000000][b]form[/b][/color]>[/color] [color=#009900]<[color=#66CC66]/[/color][color=#000000][b]body[/b][/color]>[/color] [color=#009900]<[color=#66CC66]/[/color][color=#000000][b]html[/b][/color]>[/color]
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy