Addam Posted October 31, 2002 Posted October 31, 2002 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~
Garry Claridge Posted November 1, 2002 Posted November 1, 2002 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
Addam Posted November 1, 2002 Author Posted November 1, 2002 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
Addam Posted November 1, 2002 Author Posted November 1, 2002 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
Garry Claridge Posted November 3, 2002 Posted November 3, 2002 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
Recommended Posts
This topic is 8048 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 accountSign in
Already have an account? Sign in here.
Sign In Now