Jump to content

change dropdown to textbox


Recommended Posts

hi @LL,

i have dropdown box which selects event from our sql database using arrays and php.

here is the code for the dropdown:

$selectedProductCodeTag="

<select name='selectedProd'>

<option value='eventcode'> Today, event at my place

</select>

How to change it into textbox, so users will be able to type in something like:

01-02-2009

which will be date of the event,

and eventcode will be changed to 10-02-2009

thanks

Link to comment
Share on other sites


i must not have read it good enough but im not sure what langauge but here i will explain it in vbscript.

there are many ways but this should work

<script type="text/VBScript" langauge="VBScript">
sub this()
if eventcode.selected = (true) then
document.all("div1").innerhtml="<textarea ID='1'>" & "your date here" & "</textarea>"
end if
end sub
</script>

<div ID="div1">
<select name='selectedProd'>
<option value='' selected> </option>
<option value='eventcode' id="eventcode" name="Eventcode"> Today, event at my place</option>

</select>
<button onclick="this()">ok</button>
</div>

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...