FeFe Posted July 13, 2008 Share Posted July 13, 2008 I am new in JS on the web atleast, becasue I wrote several JS for InDesign and I tought I try something simple for the web which probably is simple for the one knows it how. I was googling for a while with no success and I was also looking several forums with no success.I want to make the last item of an List editable (like the <input />) for "Custom" basically so the user can type his text.Is that possible somehow in JS with an onChange event or it can be acomplished with simple HTML code if so can someone give me a sample code of it?Thanks. Ferenc Link to comment Share on other sites More sharing options...
jeffman Posted July 13, 2008 Share Posted July 13, 2008 Something I've seen in a lot of forms is an alternative to what you're suggesting. First, you'd have a radio button next to a select element. Second, below those, you'd have a radio button next to a text input. The two radio buttons work together, so by choosing one, you're user is telling you she wants EITHER the selected option OR whatever's typed in the text element.Then, in your CGI, you'd test which radio button is selected, and that would tell you whether to use data from the select option or data from the text element. Link to comment Share on other sites More sharing options...
FeFe Posted July 13, 2008 Author Share Posted July 13, 2008 Hi Deirdre's Dad,Thanks for the fast reply. Something I've seen in a lot of forms is an alternative to what you're suggesting. First, you'd have a radio button next to a select element. Second, below those, you'd have a radio button next to a text input. The two radio buttons work together, so by choosing one, you're user is telling you she wants EITHER the selected option OR whatever's typed in the text element.Then, in your CGI, you'd test which radio button is selected, and that would tell you whether to use data from the select option or data from the text element.I do not know anything about CGI scripting/programming and I actually wanted to solve this with only JS as i know its syntax a bit more (not have much experience in JS for the web) than to start learn CGI scripting. Is there would be a way to position an hidden text box above the area of the Dropdown with JS when the "Custom" is selected from the list and when the user change the value and hit Enter than hide the text box and change the Custom to whatever the user typed?? Is this can be done? How?Ferenc. Link to comment Share on other sites More sharing options...
FeFe Posted July 13, 2008 Author Share Posted July 13, 2008 In the meantime I figured out a solution. Is not exactly I wanted, but it does what I wanted and only by using JS and simple HTML tools. Here is:Have a text box shown, than beside there is a button with either an image of an arrow or an text like "List".When user click on the button, an hidden Table is shown and when the user selet one row, than the value goes into the text box and than the table is disappear.Thanks the attention anyway!Ferenc Link to comment Share on other sites More sharing options...
Jesdisciple Posted July 13, 2008 Share Posted July 13, 2008 You could also make the "Custom..." option pass the focus to a text field (and select a radio button)... Link to comment Share on other sites More sharing options...
justsomeguy Posted July 14, 2008 Share Posted July 14, 2008 ExtJS has a nice editable combo box:http://extjs.com/deploy/dev/examples/form/combos.html Link to comment Share on other sites More sharing options...
FeFe Posted July 16, 2008 Author Share Posted July 16, 2008 Thanks for the ExtJS. It looks stuning and very fancy and good.I have never used ExtJS, but I now tested it an is looks gerat. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.