October 31, 200223 yr I don't like using the regular submit buttons... I want to write a Javascript function that will set the value of "-SortField"... but there is a dash ("-") in front of "SortField" that causes an error. Javascript get's it's handles from the "Name" of the "Input" tag. Is there another way to get around this? Thanks! ~Addam~
November 1, 200223 yr Use the form element numbers, e.g.: document.myform.elements[5].value = "myfieldname" ; Alternatively, I believe you can write: document.myform.elements["-Sortfield"].value = "myfieldname" ; Hope this helps. Garry
November 1, 200223 yr Author Thanks Garry! I should have known that! lol Here's another one... The "submit();" fuction... I can't get it to work... My goal here is to create a sortable column via the web. I can pass values to a from, but I get an error saying "Object Doesn't support this property or method". I just can't stand the look of the regular buttons... Text is better! lol
November 1, 200223 yr Author that's where I get the error... This is what I have... <form action="FMPro" method="post" name="dbsort"> <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="hidden" name="-SortOrder" value=""> <input type="text" name="-SortField" value="">Last Name <input type="submit" name="-Find" value=""> Now the submit button in this form does what it's supposed to do. I'm trying to make this more dynamic by using Javascript to pass values to a function, then that function will set the value of the "-SortOrder" & the "-SortField" and submit the form. According to O'Reilly (great books), the "submit();" function will perform whatever the action of the form. But when I use "document.dbsort.submit();" I get an Error #4, which I think is "Command is unknown" *pouting* lol
November 3, 200223 yr Try this: <form action="FMPro" method="post" name="dbsort"> <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="hidden" name="-SortOrder" value=""> <input type="text" name="-SortField" value="">Last Name <input type="hidden" name="-findall"> <input type="button" value="Sort" onclick="setsortparams()"> </form> The function "setsortparams()" can use: "document.dbsort.submit()" Hope this helps. Garry
Create an account or sign in to comment