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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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