Gossamer Forum
Home : Products : DBMan : Customization :

how to add mh= by an input field after a 'keyword' query result

Quote Reply
how to add mh= by an input field after a 'keyword' query result
Hi,

I'm using short/long display and have modified dbman a lot. I get the records (which are thumbnails in this case) nicely in a table on the page.

Now, I'd like visitors to decide how many thumbnails per page by letting them type in the numbers (input field)

When the thumbnails are shown, the actual page is not a form any more. So I thought: let's build the form again, have everything in hidden fields and pass the form with the extra (or changed) mh field.

This works, except when the page is a 'query' result. What happens then is that all the fields are filled with query and if I'd pass that on, the result would be zero...

What I could do is in stead of using a form, building a normal link and use $ENV{'QUERY_STRING'} in it, but then I would have to force choices on the visitors like: 3 6 9 12 15 etc... which I think does'n't look good at all.

Anybody any idea what I can do about it?

Thanks,

Lex
Quote Reply
Re: [Lex] how to add mh= by an input field after a 'keyword' query result In reply to
I use the following on my custom search forms so people can select the number of pages to view.

<TR><TD colspan=2><$font>Number of Hits Per Page: &nbsp; <SELECT NAME="mh">
<OPTION VALUE="0">Choose one:
<OPTION VALUE="10">10
<OPTION VALUE="25">25
<OPTION VALUE="50">50
<OPTION VALUE="100">100
<OPTION value="$number_of_records">All Records</SELECT></font></TD></TR>

$number_of_records i have defined in my .cfg file. This was a part of the mod for html_printout.

Perhaps something like this would work. I'm not sure I see exactly what you are trying to do, but perhaps that will give you ideas. Have you also checked in the FAQ under "Searching" or "Viewing" for ideas?

Unoffical DBMan FAQ
http://redundantcartridge.com/dbman/
Quote Reply
Re: [LoisC] how to add mh= by an input field after a 'keyword' query result In reply to
Hi,

what you propose is the form I was on about.

This only works 'correctly' if it is inserted in the form before the results page.

I want mine on the results page. So, if a user then wants to see more or less thumbnails, he then changes the mh. If I would use a form, with all the other stuff in hidden fields, it works, except if a keyword search has been done as all the fields are than filled with the keyword and if the form would be submitted the result would be zero, in stead of exactly the same results, only with a different amount of thumbnails.

So I tried:

<form action="$db_script_url" method="GET" name="form6">
<input type=hidden name="db" value="$db_setup">
<input type=hidden name="uid" value="$db_uid">
<input type=hidden name="view_records" value="go">
<input type=hidden name="Category" value="$in{'Category'}">
<input type=hidden name="keyword" value="$in{'keyword'}">
<input type=hidden name="Codeword" value="$in{'Codeword'}">
<input type=hidden name="Friendsonly" value="$in{'Friendsonly'}">

Number of pictures per page: <input type="text" name="mh" border="0" size="2"> <input type="submit" name="view_records" value="GO" class="inputbutton">
</form>

But this doesn't work when the page this form is on is a resultpage of a keyword search (works fine on other searches).

And only now I am thinking I should try: if it is a keyword search, only use the keyword field in this form. That should work! Angelic (However, I could get a problem on the page that this form would then return..)

How stupid that I didn't see that earlier... Blush

I'll go ahead and try it. SmileSmile