Webmastersite.net
Register Log In

Really stupid question

Comments on Really stupid question

david
Forum Regular

Usergroup: Customer
Joined: Jun 22, 2005

Total Topics: 91
Total Comments: 305
david
Posted Aug 12, 2005 - 7:34 PM:

Hey everybody,

Probably the worst question of my life.

I got a < option value="between" >is between< /option >
on my search page. the field that it's searching is an integer.

If I wanted to search between 100 and 120, what do you type into the text field??

'100 and 120'
or
'100 & 120'
or ????

I mean, I have never used one of these fields before. (with all my technical knowledge that's really weird). smiling face

Once somebody can tell, I will know for sure if I have just been missing this knowledge before, or I have been doing right and getting the errors I am getting for a reason.

Thanks
David
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Aug 14, 2005 - 4:42 AM:

'100 and 120' would work. I think '100 120' would work too. The idea is to use natural language/format, though it'd be better if it could have two fields there.
david
Forum Regular

Usergroup: Customer
Joined: Jun 22, 2005

Total Topics: 91
Total Comments: 305
david
Posted Mar 16, 2006 - 6:14 PM:

Hey Paul,

Hate to re-open this.

< input type="hidden" name="whatevercondition" value="between" / >
< input type="text" name="whateversearch" / >
< input type="text" name="whateversearch" / >

doesn't work. No errors, but it only uses the second input field for searching.

I tried
< input type="hidden" name="whatevercondition" value="<" / >
< input type="text" name="whateversearch" / >
<input type="hidden" name="whatevercondition" value=">" />
< input type="text" name="whateversearch" / >

Still nothing.
What do I have to do to have 2 text fields for the Minimum and Maximum of a search field value?

Thanks
David
david
Forum Regular

Usergroup: Customer
Joined: Jun 22, 2005

Total Topics: 91
Total Comments: 305
david
Posted Mar 18, 2006 - 7:21 AM:

Anybody else using 2 text fields where you want to search between 2 numbers? How can you do this?

I cannot use a single text field and hope that people will enter the word 'and' between 2 numbers.

I even tried to put a
< input type="text" name="whateversearch" value="and" / >
between the 2 text fields, but nothing.

Thanks
David
RedstoneMG
Member

Usergroup: Customer
Joined: Jun 15, 2005
Location: Ontario, Canada

Total Topics: 7
Total Comments: 33
Posted Mar 18, 2006 - 9:10 AM:

Sorry david, not sure of the answer myself, but I think it's a good question. I'm sure it's easy, but not aware of the coding structure.

I've used "is greater than" before, but I can see a practical application for your query.

Especially if you wanted to search for members who posted between a certain number of forum, link or comment posts. Maybe useful for searching zip codes, phone area codes, age or signup dates, ect...
david
Forum Regular

Usergroup: Customer
Joined: Jun 22, 2005

Total Topics: 91
Total Comments: 305
david
Posted Mar 18, 2006 - 2:57 PM:

But did you also use a 'is lower than' for the same searchcondition?

David
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Mar 18, 2006 - 7:19 PM:

When you put two identical fields in a forum, the rules of html mean one of them will be ignored. I can't see what you're trying to do. If you're trying to do a 'between' search, do it like the existing ones do instead of inventing a new random way to break the rules of html forms.
david
Forum Regular

Usergroup: Customer
Joined: Jun 22, 2005

Total Topics: 91
Total Comments: 305
david
Posted Mar 19, 2006 - 3:58 AM:

Hey Paul,

Apperently this works:

< input type="hidden" name="whatevercondition" value="<" / >
< input type="text" name="whateversearch" / >
<input type="hidden" name="whatevercondition" value=">" />
< input type="text" name="whateversearch" / >

No idea why it didn't work before.

David
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Mar 20, 2006 - 12:34 AM:

It shouldn't work, you're duplicating the same names twice so surely the form can only process one of them... not to mention you have the odd spaces that i'd think would make it invalid html. A "between" search would simply be

<input type="hidden" name="whatevercondition" value="between">
<input type="text" size="{STANDARDSIZE}" name="whateversearch">

exactly like the "between" searches already in the default advanced search template (except replacing the selector with the hidden input as you seem to want).
david
Forum Regular

Usergroup: Customer
Joined: Jun 22, 2005

Total Topics: 91
Total Comments: 305
david
#10 - Quote - Permalink
Posted Mar 20, 2006 - 3:13 PM:

You are right, I thought I saw it picking up both values.

In that case, let me elaborate, so you can see that this is could be something to add in a future version. I am running a site in another language. I cannot ask the visitor to literally enter the 'and' between 2 values in that single text field. Also, I don't have (can't have) space around this text field to explain to the visitor:
"please enter two numbers here, the minimum and maximum values, and be sure to leave a space between the 2 numbers."

See my point?

There should be a simple way to have 2 text fields, where they can enter the min. and max. values for a search condition (integer type).

In the meantime, any other way to solve this issue (in case you will put something like this in a future version)?

Thanks
David
david
Forum Regular

Usergroup: Customer
Joined: Jun 22, 2005

Total Topics: 91
Total Comments: 305
david
#11 - Quote - Permalink
Posted Mar 21, 2006 - 4:18 PM:

Here is a temporary solution that relies on Javascript.

<input style="width:45px" type="text" id="armin" value="" />  Ã©s
<input style="width:45px" type="text" id="armax" value="" />
<input type="hidden" name="arcondition" value="between">
<input type="hidden" name="arsearch" value="between">
<script type="text/javascript">
function copyar() {
if (document.getElementById('armin').value&&document.getElementById('armax').value) {
document.getElementById('arsearch').value=value=document.getElementById('armin').value + ' ' + document.getElementById('armax').value
}
}
</script>

<input type="submit" value="Search" onmouseover="copyar()" class="button" />
david
Forum Regular

Usergroup: Customer
Joined: Jun 22, 2005

Total Topics: 91
Total Comments: 305
david
#12 - Quote - Permalink
Posted Mar 21, 2006 - 4:48 PM:

Never mind. Even that doesn't work properly. AAARRGH.

Can we please have this function in the next upgrade? I can't really run my searches at all without such a min and max value for a search field.

David
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
#13 - Quote - Permalink
Posted Mar 21, 2006 - 8:21 PM:

value=valu e=

I presume that should be value = (without duplication).

Anyhow what I'd need to make it useful for the search page is a way to have a second box suddenly appear when someone selects 'between' from the search options. Not sure about the javascript for that.
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



This thread is closed, so you cannot post a reply.