View Full Version : Passing "name" and "value" with .submit()
12-16-2004, 03:50 PM
I am working with a DLL that uses the "name" and "value" attribues of the <input type="submit"> tag. Rather than use those ugly buttons, I want to use either an image or text link combined with "document.myform.submit();".
Trouble is, that dang dll needs the name and value attributes in order to know what to do with it. Is there any way to pass those values with the .submit() method? I haven't figured out a way to do it!
Thanks for any help!
12-16-2004, 06:01 PM
Hi there scottatdrake,
have you considered using...
<input type="image" src="your_image.jpg"/>
The coordinate points of the image click are submitted as
two name/value pairs.
12-16-2004, 06:11 PM
Hmmm.... That's an interesting point, but I'm not sure how I could work with that.
You see, there are currently many submit buttons in the same form. That dll uses name/value to tell which one was pressed. The name/value in the button must exaclty match the text in a corrisponding database field. Thanks, though!
12-17-2004, 02:51 AM
Then use a hidden field in conjuction with those image submit buttons.
<form name="myform" action="mydll.dll" method="post">
<input type="image" src="save.jpg" onclick="setAction('Save')" />
<input type="image" src="delete.jpg" onclick="setAction('Delete')" />
<input type="image" src="update.jpg" onclick="setAction('Update')" />
<input type="hidden" name="action" value="" />
Then in the dll, retrieve the value of action field to determine what action to do.
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.