md*****@yahoo.com (Mark Durgee) writes:
I have a "submit" button in a form that creates a record in my Filemaker
database that works as it should. This is the HTML for it:
<INPUT TYPE="SUBMIT" name="-New" VALUE="Add Record">
Seems correct. You are sure the server understands the minus in front
of New correctly?
I have a drop down list on that same form that works fine, but I want it to
perform the same submit action as above once a value is chosen.
That is a bad idea, since it prevents people from navigating using the
keyboard. They will only be able to hit the first option.
This is the HTML for it:
<SELECT NAME='CustNo' SIZE=1 onchange='javascript:document.form1.submit();'>
You don't need the "javascript:" (unless you are writing for IE and
having some other language as default script language for the page -
all other browsers just parse it as a Javascript label).
Since you are already in the form, you can just write:
onchange="this.form.submit();"
That would be equivalent to the onchange handler you had.
This performs the submit, but doesn't actually work. Somehow I need to pass
the name="-New" parameter in the javascript for the record to be created in
the database. How would I do that?
You could probably go through a lot of hoops to get add the parameter,
but I think the easiest way is:
onchange="this.form.elements['-New'].click();"
I still want you to reconsider submitting in the select onchange
property.
/L
--
Lasse Reichstein Nielsen -
lr*@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html>
'Faith without judgement merely degrades the spirit divine.'