www.webdeveloper.com
Results 1 to 8 of 8

Thread: Field value isn't passing

Hybrid View

  1. #1
    Join Date
    Apr 2009
    Posts
    23

    Exclamation Field value isn't passing

    Hello all,

    I have this custom made reservation form, all it does it pass the values of selected fields to the next page (form) when clicking "submit", all fields are submitting the values except 1 field the "country"

    You can view the form on the main page of the site: [LINK]

    And here is the code of the form (html/javascript)

    HTML Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <LINK href="../images.nsf/ImageStore/FR-avis.ico/$File/avis.ico" rel="SHORTCUT ICON">
    <META content="Avis Lebanon is the leading car rental company in Lebanon with a fleet exceeding 200 cars" name="description">
    <META http-equiv=imagetoolbar content=no>
    <LINK href="../../w3c/p3p.xml" rel=P3Pv1>
    <LINK href="scripts/win_ie_iQshare.css" rel=Stylesheet>
    
    <script type = "text/javascript">
    var bgMemory;	// save color information
    var fgMemory;
    var 	statusinfo = false;
    function mOver(cell, id, statustxt)
    {
         
          cell.style.cursor = 'hand';
          cell.style.backgroundColor='#e6e6e6';
    	if (typeof document.getElementById(id + "cc") == "object")
    	{
    		Elem = document.getElementById(id + "cc");
    		bgMemory = Elem.style.backgroundColor;
    		Elem.style.backgroundColor='#e6e6e6';
    	}
    	if (typeof document.getElementById(id + "l") == "object")
    	{
    		Elem = document.getElementById(id + "l");
    		fgMemory = Elem.style.color;
    		Elem.style.color='#3D6484';
    	}
    	window.status=statustxt;
    	statusinfo = true;
    	return true;
    }
    function mOut(cell, id)
    {
         
          cell.style.cursor = 'hand';
          cell.style.backgroundColor='';
          window.status="";
    	if (typeof document.getElementById(id) == "object")
    	{
    		Elem = document.getElementById(id + "cc");
    		Elem.style.backgroundColor = bgMemory;
    	}
    	if (typeof document.getElementById(id + "l") == "object")
    	{
    		Elem = document.getElementById(id + "l");
    		Elem.style.color = fgMemory;
    	}
    	window.status='';
    	statusinfo = false;
    	return true;
    }
    function mClick(cell)
    {
       if(event.srcElement.tagName=='TD')
       {
          cell.children.tags('A')[0].click();
       }
    }
    </script>
    <script type = "text/javascript">
    var xMonths = new Array( 'jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec' );
    
    function getListValue( option_object  ){return option_object[ option_object.selectedIndex ].value;}
    
    function setListValue( option_object, value  ){ option_object.selectedIndex = value;}
    
    function addDays(myDate,days) {
        return new Date(myDate.getTime() + days*24*60*60*1000);
    }
    function init()
    {
    xToday = new Date();
    yToday = addDays(new Date(),3);
    
    xMonth = xToday.getMonth();
    xDay = xToday.getDate()-1;
    xYear = xToday.getYear()-2005; if (xYear < 2005) xYear=0;
    
    yMonth = yToday.getMonth();
    yDay = yToday.getDate()-1;
    yYear = yToday.getYear()-2005; if (yYear < 2005) yYear=0;
      xF = document.forms['quickbooking'];
      setListValue( xF.country, xCountry )
      setListValue( xF.ETAHour, 9 )
      setListValue( xF.ETAMonth, xMonth )
      setListValue( xF.ETADay, xDay )
      setListValue( xF.ETAYear, xYear )
      setListValue( xF.ETTHour, 9 )
      setListValue( xF.ETTMonth, yMonth )
      setListValue( xF.ETTDay, yDay )
      setListValue( xF.ETTYear, yYear )
    }
    
    
    function openhelp( hlpString )
    {
        hlpWin = window.open( hlpString , 'Help', 'width=395,height=345,resizable=yes,scrollbars=yes,status=yes')
        hlpWin.focus();
    }
    
    function doContinue( )
    {
    xF = document.forms['quickbooking'];
    xCountry = getListValue( xF.country );
    xETADay = getListValue( xF.ETADay );
    xETAMonth = getListValue( xF.ETAMonth );
    xETAYear = getListValue( xF.ETAYear );
    xETAHour = getListValue( xF.ETAHour );
    xETAMinute = getListValue( xF.ETAMinute );
    xETA = xETADay + xMonths[ parseInt( xETAMonth )-1 ] + xETAYear.substr(2,2) + '/' + xETAHour + xETAMinute;xETTDay = getListValue( xF.ETTDay );
    xETTMonth = getListValue( xF.ETTMonth );
    xETTYear = getListValue( xF.ETTYear );
    xETTHour = getListValue( xF.ETTHour );
    xETTMinute = getListValue( xF.ETTMinute );
    xETT = xETTDay + xMonths[ parseInt( xETTMonth )-1 ] + xETTYear.substr(2,2) + '/' + xETTHour + xETTMinute;
    xWizardNumber = xF.wizard_number.value;
    xName = xF.surname.value ;
    xParams = '&CTR=' + xCountry +'&Country=' + xCountry + '&ETA=' + xETA + '&ETT=' + xETT+ '&CNAM=' + xName + '&WIZ=' + xWizardNumber+'&SOR=0038780x';
    url = 'http://book.rent-at-avis.com/avisonline/ibe.nsf/PrefillX?OpenAgent&ResStep=ReservationStep1&IBEOwner=EU&LNG=GB' + xParams;location.href = url;
    }
    window.onload = init;
    </script>
    
    <script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
    
    </script>
    I really appreciate your help.

  2. #2
    Join Date
    Oct 2008
    Location
    U.S.
    Posts
    726
    The country select's value is passing in the url. The problem must be on the receiving page, the select is not being set to the option with the value that was passed for country.

  3. #3
    Join Date
    Apr 2009
    Posts
    23
    Quote Originally Posted by astupidname View Post
    The country select's value is passing in the url. The problem must be on the receiving page, the select is not being set to the option with the value that was passed for country.
    The receiving page is actually an iframe and the actual page is being linked from an external site which I don't have access to.

    But I didn't understand what you said about the select is not being set to the option with the value...

  4. #4
    Join Date
    Apr 2009
    Posts
    23
    I just found out that the input name of the country field in the iframe is "Country" and in my custom made page is "country"

    You think this is what's wrong? could it be case sensitive?
    Last edited by drugoholic; 06-12-2009 at 04:35 AM.

  5. #5
    Join Date
    Oct 2008
    Location
    U.S.
    Posts
    726
    But I didn't understand what you said about the select is not being set to the option with the value...
    All I'm saying is I went to the page, selected Iceland in the country dropdown, filled in a phony e-mail and submitted. On the next/same/whatever page after submitting, the country value was in the url in address bar: 'Country=ISO' (so in other words, the select's value is being passed in the url correctly) but the country select (which is in the avisworld src'd iframe) is set to Lebanon (the Lebanon option has: selected="" attribute), not Iceland like I presume it's supposed to be since that was my prior selection? (I would presume that to be pre-selected for me on the following page after submitting is what I'm saying, don't know if you're actually set-up to do so or not). The select IS named 'Country', there is a hidden input named '&#37;%Surrogate_Country' if that's what you are referring to, don't know what that input is for.

  6. #6
    Join Date
    Oct 2008
    Location
    U.S.
    Posts
    726
    You think this is what's wrong? could it be case sensitive?
    Best thing to do if you find something like that, is to try changing it. I actually did not notice a case difference and I thought I did look at that. These things can be mighty slippery!

  7. #7
    Join Date
    Oct 2008
    Location
    U.S.
    Posts
    726
    Also am receiving error (both before and after submission) in Firebug console saying:
    $("el-botsl") is null
    makeEqualHeight ($('el-botsl').getChildren());
    apparently coming from: el.scripts.js line 67

  8. #8
    Join Date
    Apr 2009
    Posts
    23
    I don't know what else to do, it's not case sensitive coz I tried with no luck.
    And yes the select field has a "selected" on Lebanon, since it's a lebanese website.

    I don't know what could the error be...

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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