Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with Form and postback

Status
Not open for further replies.

BrianBurgit

IS-IT--Management
Dec 13, 2004
95
US
I am new to PHP. I have a form with several HTML input fields for the user to fill in. One of those fields is for the user to enter an amount. I have a HTML input field of type image. When the image is clicked, I want to populate another input field, type text, with an amount I calculate using the amount entered by the user and some math I do in a Javascript function. This all works, except clicking the image causes a postback, and the calculated amount is then gone.

Is what I am attempting to do correct?

Thanks,

Brian
 
it sounds like you are not doing anything that involves php.

i would bet that you are using an <input type=image> tag rather than an <img> tag. the latter would not cause the form to submit whereas the former would.

you can attach an onclick event to the <img> tag in javascript.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top