Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jul 2012
    Thanked 0 Times in 0 Posts

    html form javascript to booking system

    I've got a simple booking form and want to transfer the data into a different 'booking' page in an iframe as we use an external booking system - but I'm having some trouble working this out. I have this code:

    [code] <form id="bookForm" action="skiddawtest.php" method="get">
    <input type="hidden" name="siteId" value="LDHSKIDDAW" />
    <input type="hidden" name="chainAction" value="newAvailabilitySearch" />
    <label for="departure">Arrival</label>
    <input type="text" id="departure" name="arrival" />
    <input id="arrival" name="departure" type="hidden" />
    <label for="numberOfPersons">Nights</label>
    <select id="nights" name="nights">
    <label for="numberOfPersons">Adults</label>
    <select id="numberOfPersons" name="numberOfPersons">
    <option selected="selected" value="1">1</option>
    <option value="2">2</option>
    <option value="3">3</option>
    <br />
    <label for="bookForm_offerCode">Offer Code</label>
    <input type="text" id="bookForm_offerCode" name="bookForm_offerCode" />
    <input id="bookForm_0" value="Search" class="ui-button ui-widget ui-state-default ui-corner-all" onclick="$.publish('indicator');" type="submit" />

    And have tried both these on a separate page to try and pull in the data:

    [CODE] <iframe src="https://uk1.roomlynx.net/rezrooms2/loadOBMApplication.action?siteId=LDHSKIDDAW&amp;chainAction=newAvailabilitySearch" frameborder="0" width="950" height="1200"></iframe>

    <iframe src="https://uk1.roomlynx.net/rezrooms2/loadOBMApplication.action?siteId=LDHSKIDDAW&amp;chainAction=newAvailabilitySearch&amp;arrival=number OfNights=numberOfPersons=offerCode=" frameborder="0" width="950" height="1200"></iframe>[CODE]

    The top one just brings in from todays date, the bottom one doesn't work. I don't know what else I could do to bring in the data? The date/night details appear in the address bar in the i-frame page which indicates to me that something is working, but its not getting brought into the actual booking portal.

    Form code - http://www.lakedistricthotels.net/skiddawtest.html<br>
    i-frame page - http://www.lakedistricthotels.net/skiddawtest.php

    Any help would be appreciated.

  2. #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Thanked 4,947 Times in 4,908 Posts
    Can't be done. Period.

    JavaScript can *NOT* access any pages that come from a different domain than the domain where the JS code originated.

    *IF* you have control of BOTH servers, you can use message events to pass data. That is, you can write special code for the uk1.roomlynx.net site that would accept messages sent from the www.lakedistricthotels.net site. But if you can't alter the code on uk1.roomlynx.net site, then you can't do it.

    You *MAY* be able to do some of this with the help of server-side code, but it depends on how carefully controlled that roomlynx.net site is. Since it is https:// you may find it quite difficult. Likely the best thing you can do is contact the owners of roomlynx.net and ask if they can provide you with an API for this purpose.
    Be yourself. No one else is as qualified.


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