www.webdeveloper.com
Results 1 to 1 of 1

Thread: passing variable

  1. #1
    Join Date
    May 2011
    Posts
    46

    passing variable

    I have following function:
    Code:
    function selectThis(id){
            var bs=document.getElementById("bs").selectedIndex;
            var ad=document.getElementById("ad_" + id).selectedIndex;
            var ns=document.getElementById("ns_" + id).selectedIndex;
            var wt=document.getElementById("wt_" + id).selectedIndex;
            var ins=document.getElementById("in_" + id).selectedIndex;
    	locationstring = id + "&bs=" + bs + "&ad=" + ad + "&ns=" + ns + "&wt=" + wt + "&ins=" + ins; 
    
    }
    How can I get this id from above (not the whole string) in the function below
    Code:
    </script>
    
    <script language="JavaScript" type="text/JavaScript">
    
    document.observe('dom:loaded', function() {
    $('I NEED ID HERE?').observe('click', showAjaxFormDemonstration);
    });
    function showAjaxFormDemonstration(event) {
    Event.stop(event);
    Lightview.show({
    href: 'ajax/offices.php?book=' + locationstring,
    rel: 'ajax',
    options: {
    autosize: true,
    topclose: true,
    ajax: {
    method: 'get',
    onComplete: function(){
    // once the request is complete we observe the form for a submit
    $('ajaxForm').observe('submit', submitAjaxFormDemonstration);
    }
    }
    }
    Last edited by Kor; 05-12-2011 at 09:01 AM. Reason: wrap the code [code][/code]

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles