Jump to content

Link in Select Option?


dream25

Recommended Posts

Hi,

 

    Im new to HTML, i just plan to create one page with a image by using the select option, there are 4 choice, right, left, top, bottom, if  i click the right option, the image will be in the right side of the page, like the remaining options, how can i code for this, plz help me. the code below i tried here..

<html>

<head>

<title>picture</title>

<form method="post" action="circle.html" >

<select>

<option>Please select your option</option>

<option value="Left">Left</option>

<option value="Right">Right</option>

<option value="Top">Top</option>

<option value="Bottom">Bottom</option>

</select>

</form>

<img src="file:///C|/Documents and Settings/SES.SUMITAA-4088532/My Documents/My Pictures/001.jpg"

</head>

</html>

 

Thanks in Advance

Link to comment
https://forums.phpfreaks.com/topic/132538-link-in-select-option/
Share on other sites

So you're trying to position the image based on a selected option from a form?

 

Well, to start, HTML can't do anything with form values, so you'll want your form to point to a page that can (like php). So if this is the code for circle.html, change your filename to circle.php and learn a little basic PHP.

you could have the form submit post data via php and use get to then pull the selected option to a css class

 

 

 

so if user selects right

 

the div becomes

 

div class="right">img</div>

or if user picks left

 

gets the left side div..

 

i cant really write out the entire code but yeah use post and then get the data from the form and use it as a css classname

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.