php - edit textbox value in magento -


I'm new to Magenta Extension developments.

On clicking I have to change my textbox value on the button, the following in Magenta are some important part of my code. When this is the same I try in simple PHP, why not work in Magenta ?

My script is:

  & lt; Script type = "text / javascript" & gt; Function changeText2 () {var street = document.getElementById ('street_1'). Values; Var city = document. GetElementById ('city'). value; Var state = document.getElementById ('region'). value; Var zip = document.getElementById ('zip'). Values; Var newcity = document.getElementById ('newcity'). value; Document.getElementById ('city') innerHTML = Newcity. Confirm Return (City); Back true; } & Lt; / Script & gt;  

This button is the code:

  & lt; Div class = "field" & gt; & Lt; Label = "city" class = "required" & gt; & Lt; Em> * & Lt; / Em> & Lt ;? Php echo $ this- & gt; __ ('city')? & Gt; & Lt; / Label & gt; & Lt; Div class = "input-box" & gt; & Lt; Input type = "text" name = "city" value = "& lt ;? php echo $ this-> escapeHtml ($ this-> getAddress () -> getCity ())? & Gt; Title = "& lt ;? php echo $ this- & gt; __ ('city')? & Gt;" Class = "input-text  subsidiary ('customer / address') -> getAttributeValidationClass ('city')? & Gt;" Id = "city" /> & Lt; / Div & gt; & Lt; / Div & gt;  

This is my file code:

  & lt; Input type = "text" value = "xyz" id = "newcity" & gt; & Lt; Input type = "submit" name = "truemagentosubmit" value = "submit this form exactly" onclick = 'changeText2 ()' />  

When I click on the submit button, it will change the value of the text text whose ID is the city.

Please give me some suggestions on this code. How can I fix this?

Change:

  document.getElementById ('city') innerHTML =. From  

to:

  document.getElementById ('city'). Value = newcity;  

Try more


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -