HTML Help
HTML Help Central . com

» Online Users: 38

0 members and 38 guests
No Members online
Most users ever online was 695, 02-16-2011 at 08:01 AM.

» Site Navigation

 > FAQ

» Domains For Sale

Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2008
    Posts
    2

    Posted in wrong forum - sorry

    *** Sorry I posted this in the wrong forum ***


    I am trying to use a multi-value select to fill in input fields on a form but it isn't working. I can select from the drop-down but it doesn't fill in the text fields on the screen. I used a solution found in this forum as the basis for this code but when mine didn't work I tried the original code and it didn't work for me either. What am I doing wrong?

    <script type="text/javascript"><!--
    function onsel(){var form = document.forms[0];

    if(form.office.selectedIndex==0){ // Don't display anything if first option is selected
    form.strt2.value =""; form.city2.value =""; form.stnm2.value =""; form.zipc2.value ="";
    return;
    }

    form.strt2.value = form.office.options[form.office.selectedIndex].value.split("|")[0];
    form.city2.value = form.office.options[form.office.selectedIndex].value.split("|")[1];
    form.stnm2.value = form.office.options[form.office.selectedIndex].value.split("|")[2];
    form.zipc2.value = form.office.options[form.office.selectedIndex].value.split("|")[3];
    }
    //--></script>

    <form action="http://maps.msn.com/directionsFind.aspx" method="get" style="margin-bottom:0" target="_blank">
    <select onclick="onsel()" name="office">
    <option>Choose Office Location...</option>
    <option value="2801 Youngfield St |Golden |CO |80401">Golden</option>
    <option value="12001 63rd Pl |Arvada |CO |80004">Arvada</option>
    <option value="808 S Public Rd |Lafayette |CO |80026">Lafayette</option>
    </select><br />
    <input type="text" name="strt2" value="" /><br />
    <input type="text" name="city2" value="" /><br />
    <input type="text" name="stnm2" value="" /><br />
    <input type="text" name="zipc2" value="" /><br />
    <input border="0" src="../addon/maps/white_plan_route.gif" type="image">
    </Form>
    Last edited by jyoung00; 11-14-2008 at 02:33 PM. Reason: Posted in wrong forum

  2. #2
    Join Date
    Mar 2005
    Location
    Singapore
    Posts
    1,766

Similar Threads

  1. Multi-value select doesn't fill in text fields
    By jyoung00 in forum Javascript / AJAX / VBScript
    Replies: 1
    Last Post: 11-14-2008, 11:00 PM
  2. selecting a part of an image...
    By Likenota in forum Flash / Multimedia
    Replies: 1
    Last Post: 07-31-2006, 01:48 AM
  3. Selecting fonts for a website
    By pianoman7845 in forum HTML / XHTML / XML
    Replies: 10
    Last Post: 10-07-2003, 06:37 PM
  4. Validation beyond just text fields
    By Apollo Becate in forum Javascript / AJAX / VBScript
    Replies: 3
    Last Post: 02-27-2002, 10:36 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Powered by vBadvanced CMPS v4.1.1