facebook

[STRUTS] html:select also editable as a textfield

  1. MyEclipse IDE
  2.  > 
  3. Off Topic
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #249385 Reply

    perret
    Member

    Hi there! 😀

    Hope the modos team are fine. I didn’t find what i was looking for with my previous search. That’s why i am asking for your help. I was just wondering if it was possible to create an html:select in which you could also write something like in a textfield.
    I know it’s possible in PHP so please don’t tell me it’s not in JSP 😆 I would be very sad…

    Thanks in advance for your time.

    bye

    #249435 Reply

    Riyad Kalla
    Member

    Moving to OT > Soft Dev

    I don’t quite follow what you mean. html:select will generate either a dropdown or a multi-selection list, but you are asking about a text box. If this can be done in PHP, show a code snippet for the HTML that does it, then someone can help you.

    #249449 Reply

    perret
    Member

    @support-rkalla wrote:

    Moving to OT > Soft Dev

    I don’t quite follow what you mean. html:select will generate either a dropdown or a multi-selection list, but you are asking about a text box. If this can be done in PHP, show a code snippet for the HTML that does it, then someone can help you.

    Oh sorry for posting in the wrong forum…

    I’am asking to friend of mine who devellop in PHP. He’s about to give me the code 😉

    Anyway, here is a screenshot of one of our delphi app. As you can see it is a dropdown editable. I am able to edit every field of it.

    What i want to do in my JSP is this kind of dropdown, even if it’s not possible to edit every field, one blank field editable at the end of the select would be perfect 🙂

    Hope you understand better that way, sorry for my poor english.

    #249462 Reply

    Riyad Kalla
    Member

    There is no HTML control that offers this kind of functionality. You might be able to hack something together using JavaScript and a custom text field and a html:select box, but there is no control out of the box that will do this.

    #249469 Reply

    perret
    Member

    @support-rkalla wrote:

    There is no HTML control that offers this kind of functionality. You might be able to hack something together using JavaScript and a custom text field and a html:select box, but there is no control out of the box that will do this.

    That’s what i tought 😥

    But i’m on it i found a script that makes this work!

    When i’ll success, i’ll come back here and post the code 😉

    Thanks rkalla 😉

    #249473 Reply

    Riyad Kalla
    Member

    perret that would be fantastic, thank you for doing that.

    #249701 Reply

    perret
    Member

    @support-rkalla wrote:

    perret that would be fantastic, thank you for doing that.

    Hello 🙂

    I tried to but didn’t succeed to implement it in my struts app! In case of a simple jsp page, it does works.

    rkalla, may you try to make it works with struts with html:text and html:select ? Here is the code, if you don’t have time i understand. Thanks anyway! 🙂

    <html>
    
    <!-- script d'init -->
    <script>
        function onSel(id){        var eTxt=document.getElementById(id+'txt');
            var eSel=document.getElementById(id+'sel');
            var eImg=document.getElementById(id+'img');
            if(eSel.style.visibility=='visible')
            {
                eSel.name='sel1old';
                eSel.name='sel1old';
                eTxt.name=id;
                eTxt.style.visibility='visible';
                eSel.style.visibility='collapse';
                eSel.disabled=true;
                eTxt.disabled=false;
                eImg.src='http://static.php.net/www.php.net/images/notes-add.gif';
            }
            else
            {
                if(eTxt.value)
                {
                    var option=new Option(eTxt.value,eTxt.value);
                    eSel.options[eSel.options.length]=option;
                    eSel.selectedIndex=eSel.options.length-1;
                }
                eSel.name=id;
                eTxt.name='sel1old';
                eTxt.style.visibility='collapse';
                eSel.style.visibility='visible';
                eSel.disabled=false;
                eTxt.disabled=true;
                eImg.src='http://static.php.net/www.php.net/images/small_submit.gif';
            }
            return(1);
        }
    </script>
    
    
    
    <body>
    <form>
    
        <input  id='nomDuGroupetxt' disabled name='nomDuGroupeold' type=text style='position:absolute; visibility:collapse; width:120px;'/>
        <select id='nomDuGroupesel' name='nomDuGroupe' style='visibility:visible; width:120px;'>
            <option value="liste1">liste predefinie 1</option>
            <option value="liste2">liste predefinie 2</option>
        </select>
        <img  onmouseout="nd();"  id='nomDuGroupeimg' align='middle' 
            onclick='onSel("nomDuGroupe");' src='http://static.php.net/www.php.net/images/small_submit.gif'/>
    </form>
    </body>
    
    </html>
Viewing 7 posts - 1 through 7 (of 7 total)
Reply To: [STRUTS] html:select also editable as a textfield

You must be logged in to post in the forum log in