SpeedRFP

Enterprise Form Advanced Options

Checkbox

This page provides step-by-step examples of more advanced techniques to apply SpeedRFP to your website. In particular, we cover the case where you have a checkbox that will feed UIDs to the SpeedRFP widget.

OutputHTML
XX94N - A Demo Gold Resort
JB811 - A Demo Property
TXS38 - A Demo Resort
<form id="hotelpicker">

<input type="checkbox" name="hotels" value="XX94N" />XX94N - A Demo Gold Resort
<br /><input type="checkbox" name="hotels" value="JB811" />JB811 - A Demo Property
<br /><input type="checkbox" name="hotels" value="TXS38" />TXS38 - A Demo Resort

</form>

The following JavaScript is used:
function getHotelUids()
{
  var uids = "";
  var form = document.getElementById("hotelpicker");
  for ( i=0; i<form.hotels.length; i++ )
  {
    if ( form.hotels[i].checked )
    {
      if ( !form.hotels[i].value ) continue;	// skip blank uids
      uids = ( uids ) ? uids + "," + form.hotels[i].value : form.hotels[i].value;
    }
  }
  
  return uids;
}

The following SpeedRFP options are used:
<script type="text/javascript" charset="utf-8">
var options = {};
options.display = "overlay";
options.key = "fc959b6624924310"; 

options.populateUid = "getHotelUids";
options.clear_previous = true;

var srfp_widget = new srfp.widget(options);
</script> 

Explanation

The checkbox form above has the id "hotels". When the user clicks the SpeedRFP button, it will call getHotelUids(). That function returns a comma-delimited string of the selected UIDs. Something like: "XX94N,JB811"

options.populateUid = "getHotelUids"; This tells SpeedRFP to call that function any time the SpeedRFP window is opened from its native button.

Additional SpeedRFP Options

We set a few options in our SpeedRFP widget.

options.populateUid = "getHotelUids";
The name of a function to run before SpeedRFP is loaded. That function should return a string of comma-delimited list of UIDs.

options.clear_previous = true;
Tells SpeedRFP to clear any previous UIDs already set if a SpeedRFP window was previously opened. Defaults to false.

How can SpeedRFP make this page better for you?




Send feedback

Thank you!

We review all feedback to ensure SpeedRFP keeps getting better.