Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Oct 2006
    Location
    Spain
    Posts
    147
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Cool Option selection with 2 values

    Hi friends,

    It is strange, I know. I don´t know if it is a question for JS experts or ASP experts also!

    I want access an Asp script which access an MSAccess table!

    It is I did:



    <div align=center>
    <TD>
    <TABLE bgColor=#e5e5e5 border=0 cellPadding=0 cellSpacing=0
    height=40>
    <FORM action="frases2.asp" method=get onSubmit="return verifica(this);">
    <TBODY>
    <TR align=middle vAlign=center>
    <TD align=right height=40 noWrap>&nbsp;</TD>

    <TD>&nbsp;&nbsp;<SELECT name="look_for"><OPTION selected
    value="empina" value2="codo">empinar el codo<OPTION value="anda" value2="gorra">andar de gorra
    <OPTION value="a pie" value2="juntillas">a pie juntillas
    &nbsp;&nbsp;&nbsp;&nbsp;<OPTION value="hac" value2="menudo">hace mala sangre
    </OPTION>

    </SELECT>&nbsp;&nbsp;</FONT>
    <CENTER></CENTER></TD>
    <TD><input type="button" value="Go!" style="height : 25; width : 30;" onClick="makeWord(this.form.look_for)">
    &nbsp;</TD></TD></TR></FORM></TBODY></TABLE></TD></div>


    Can you see I create two VALUES (value and value2). How I dod this works fine?

    value it is a field value2 it is another field.

    Thank you in advance

    LeBRON LeTCHEV

  • #2
    Senior Coder
    Join Date
    Mar 2005
    Location
    Portsmouth UK
    Posts
    4,501
    Thanks
    3
    Thanked 500 Times in 487 Posts
    value="fred,tom"


    then
    var val=value.split(',')=
    and

    val[0]='fred';
    val[1]='tom';

    the reverse

    var val=['fred','tom'];

    options[1].value=val.join(',');
    Vic

    God Loves You and will never love you less.

    http://www.vicsjavascripts.org/Home.htm

    If my post has been useful please donate to http://www.operationsmile.org.uk/


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •