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

Omit these and find these... newbie!


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

Recommended Posts

Posted

Not quite sure how to tackle this...

Like the FMP App... wich allows you to do a find, then a new request, and another if needed, and so on.

Then you hit FIND and you get your results. How is that pulled off using webcompanion? I'm using some custom pages and I would like to be able to do that as well.

I'm new at this portion of filemaker so please bare with me!

Thank you!!!!

I wish it was as easy as Javascript!

Posted

Ok... I've got the CDML Reference Database...

I was FIRST trying to just use some of the operators to see how they work...

but I don't think I'm getting what I'm asking for.

Example:

I have 6 records... field: "First Name" had 4 people who's names begin with the letter "J".

When I use the "neq" value in the "-Op", I was expecting to see eveything that DIDN'T contain the letter "J", but I get the opposite...

Here is the syntax I'm using w/ explinations:

<script language="JavaScript">

function adval(){

var f=document.forms[0];

f.elements[4].value = f.setPar[f.setPar.selectedIndex].value;

alert("The Value of the '-Op' is: "+f.elements[4].value);

}

</script> ...

<-- The javascript set's the "-Op" value based upon the selection. The Alert is just to make sure the value is being set.-->

...<form action="FMPro" method="post" name="find">

<input type="hidden" name="-DB" value="bammo.fp5">

<input type="hidden" name="-format" value="thepage.html">

<input type="hidden" name="-lay" value="testing">

<input type="text" name="-Op" value="">

<select name="setPar">

<option value="neq">not equals</option>

<option value="eq">equals</option>

<option value="ew">ends with</option>

<option value="cn">contains</option>

</select>

<input type="text" name="First Name" value="">

<input type="text" name="Last Name" value="">

<input type="submit" name="-find" value="done" onClick="adval();">

</form>

This looks right to me. Does anyone know what I'm doing wrong, or am I expecting something that's not supposed to happen.

Thanks!

~Addam~

Posted

Addam,

Remove the name parameter from the <select.. tags. This is because FM will look for a field by that name.

Try this Javascript:

<script language="JavaScript">

function adval(){

var f=document.find;

f.elements["-Op"].value = f.elements[4][f.elements[4].selectedIndex].value;

alert("The Value of the '-Op' is: "+f.elements["-Op"].value);

}

</script>


Good Luck.

Garry

Posted

Addam,

I have just had a rethink on this. Try this (no Javascript needed)B)

<form action="FMPro" method="post" name="find">

<input type="hidden" name="-DB" value="bammo.fp5">

<input type="hidden" name="-format" value="thepage.html">

<input type="hidden" name="-lay" value="testing">

<select name="-Op">

<option value="neq">not equals</option>

<option value="eq">equals</option>

<option value="ew">ends with</option>

<option value="cn">contains</option>

</select>

<input type="text" name="First Name" value="">

<select name="-Op">

<option value="neq">not equals</option>

<option value="eq">equals</option>

<option value="ew">ends with</option>

<option value="cn">contains</option>

</select>

<input type="text" name="Last Name" value="">

<input type="submit" name="-find" value="done">

</form>


All the best.

Garry

This topic is 8036 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.