3

I have HTML and CSS page and I need to make one image clickable and have to open new page with message "You order is complete"

The button actually confirm form with several fields over which it is located. Can you help me do that?

2 Answers2

2

Well at the very basic you can wrap your image in a hyperlink.
Adding the attribute target="_blank" tells the browser to open the link in a new tab or window.

<a href="http://www.google.com" target="_blank">
    <img src="http://www.google.co.uk/images/srpr/logo11w.png" width="400" height="100" alt="Google"/>
</a>
Ashley Medway
  • 7,151
  • 7
  • 49
  • 71
2

This code may help you open your desired new page with the contents you mentioned.

<a href="myPage.html" target="_blank" >
<img src="myImage.png" alt="some image" />
</a>

and myPage.html will contain the following

<body>
<p>You order is complete</p>
</body
Kalel Wade
  • 7,742
  • 3
  • 39
  • 55
Kashif
  • 439
  • 6
  • 10
  • With this solution thisn not submit nothing from the form. I have form with 2 required fields. Yes this opens new page , but with no connection to the form ?!? – Petyo DImitrov Feb 17 '15 at 20:35
  • You can add this code to your form attribute; please see the onsubmit thing:
    . Reference: http://stackoverflow.com/questions/896724/how-to-open-a-new-window-on-form-submit
    – Kashif Feb 17 '15 at 21:34