[Last Call] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 189
  • Last Modified:

Displaying form variables

Dear Experts

I have a search form with a form field 'radius' which upon selection populates a couple of hidden form fields with data.  Upon selection of the radius form field it also appends the words 'scottish borders' to an earlier form field called pPostCode - see code below.

I am displaying the pPostCode form value on the results page but would like to display the value without the words 'scottish borders'.

Can anyone advise if this is possible.

Please see link below to the website - if you enter the word 'kelso' into the Area field it will return some results.

<select name="radius" id="radius" onclick="document.form2.pPostcode.value  ;usePointFromPostcode(document.getElementById('pPostCode').value += ' scottish borders',
    function (point) {
                <option value="0">Select </option>
                <option value="0.5">1/2 mile </option>
                <option value="1">1 mile</option>
                <option value="2">2 miles</option>
                <option value="3">3 miles</option>
                <option value="4">4 miles</option>
                <option value="5">5 miles</option>
                <option value="10">10 miles</option>
                <option value="15">15 miles</option>
                <option value="20">20 miles</option>
                <option value="30">30 miles</option>
                <option value="40">40 miles</option>
                <option value="50">50 miles</option>
                <option value="9999">Anywhere</option>

Open in new window

  • 2
  • 2
1 Solution
you can just do a replace(FormValue, "scottish borders", "")

this will remove the text from the string.
grantballantyneAuthor Commented:
Thanks Brad

The code below represents me displaying the form field pPostCode on the results page.  Can you advise on how I use your suggestion within this code to eliminate the text 'scottish borders'

Thanks again
Distance from <%= UCase(Request.Form(RTRIM("pPostcode"))) %><strong><%= UCase(Request.QueryString(RTRIM("pPostcode"))) %></strong>: &nbsp;<%= FormatNumber((propertyresults.Fields.Item("").Value), 2, -2, -2, -2) %> miles

Open in new window

this should do it for you.

Distance from <%= replace(UCase(Request.Form(RTRIM("pPostcode"))), "scottish borders", "") %><strong><%= replace(UCase(Request.Form(RTRIM("pPostcode"))), "scottish borders", "") %></strong>:  <%= FormatNumber((propertyresults.Fields.Item("").Value), 2, -2, -2, -2) %> miles
grantballantyneAuthor Commented:
brilliant thanks Brad

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now