MSFN Forum: change dropdown to textbox - MSFN Forum

Jump to content



Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

change dropdown to textbox Rate Topic: -----

#1 User is offline   kabucek 

  • Member
  • PipPip
  • Group: Members
  • Posts: 102
  • Joined: 07-August 06

Posted 08 January 2009 - 06:50 PM

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


#2 User is offline   ryuko 

  • Newbie
  • Group: Members
  • Posts: 27
  • Joined: 31-December 08

Posted 08 January 2009 - 08:05 PM

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>


Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy