Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7280 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Is it possible to code a search form using CDML to use one of a couple format files to return the results, depending on a choice the web user makes? I have a couple search pages that are identical in format; the only difference is in their coded form info that specifies a different format file for returning the search results. It would simplify things if I could allow the user to choose which format file to use based on the kind of info they want returned (for example, online list with linked details, or printable copy, etc.)

Any ideas?

Thanks in advance,

Peter Knowles

Posted

A couple of ways exist.

One is to have a drop-down menu:

<select name="-format">

<option value="mypage1.html">Page 1</option>

<option value="mypage2.html">Page 2</option>

<option value="mypage3.html">Page 3</option>

....

</select>

Another is to use some Javascript:

In the <head>:

<script>function subform(fpage) {

document.myform.elements['-format'].value = fpage;

document.myform.submit(); }</script>

In the <body>:

....

<a href="#" onclick="subform('page1.html');">Page 1</a>

<a href="#" onclick="subform('page2.html');">Page 2</a>

<a href="#" onclick="subform('page3.html');">Page 3</a>

....

All the best.

Garry

This topic is 7280 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.