celerity submit form by pressing enter - jruby

I'm trying to use celerity to submit a form. This form has a generated link that is called when the user hits the enter button. How do I trigger this?
I know you can submit by finding the link / button and pressing .click(). But I want to submit by pressing enter.
I noticed that celerity form objects has a:
(Object) submit
Submits the form.
http://celerity.rubyforge.org/yard/Celerity/Form.html#submit-instance_method
but I cant seem to access it. Thanks in advance

Related

How to show an alert / text box after submitting (button) an option value (from drop-down list)?

I can't seem to find how to make this work - selecting an option from the drop-down list & submitting it using a submit button then having an alert / text box show after after clicking submit button. Is it possible ? TIA
What language do you use? if it web, you can add javascript to check your value dropdown.
you can add onSubmit on your form

Automatically Submitting a Form Using a Link

I would like to use a link that takes the user to an external site and automatically hits the "submit" button on a form. Is this possible with HTML?

Opening up a seperate form in a continous form

I have a continuous form that my users would like to view. It is shown as below.
I want to allow the user to open up a more detailed form by click on the swab locations that are specific to the asset ID. Let's say user clicks on MFG 0252.
A window with the following should pop-up. I am not sure how i can go about this. Is there a way for hyperlinks to do it? or other other methods which are better?
on the OnClick event of your button:
docmd.OpenForm "tblMainSwapLocation",acNormal,,"[Asset_ID]='"+ Me.[Asset_ID]+"'",,acDialog
where Me.[Asset_ID] is the field name containing the Asset_ID in your form.
acDialog will open the form as PopUp
Hope this will help

submit button submits wrong form

I have two forms, a login form and a register form on the same page and each has its own submit button. If I fill in bad data and click on submit button on register form, I get the form back with errors ( expected). If I now enter sign in details on signin form and click on signin form's submit button, the register form gets submitted.
This is strange behaviour. I am not sure where to start search for this. I am using firefox to test this.
Thanks
Well, you will need to debug it step by step.
Check your form nesting and follow good structure, make sure both form are not overlapping with each other or not being closed properly.
Give you form a proper ID and NAME. Be careful when two forms have the same name From Name Attr.
Based on your structure and your question, make sure you have a different submit buttons for each form and that button is placed within the form nesting.
Same as for the forms, give your submit button a proper unique ID and NAME .
Choose whether you want to submit by your using submit in html, or having JS to submit the form for you JS submit form.
If you are using HTML5, you can separate the button from the FORM. They can run separately. Means dynamic association between the form and it's submit button by having submit button placed anywhere and can submit a form located in different place. Check Association of Controls and Forms & HTML5′s New “form” Attribute.
Please post some code in order for us to have a better understanding of your issue.
Good luck.

Wrong form submission using Enter Key when there are two submit buttons

I have a form with two submit buttons - one for Cancel and the other is for Saving form values to the DB . When Enter key is pressed, the Cancel button submits the form instead of the Save button submitting the form. How can I make the Save button submit the form when Enter key is pressed?
Thanks,
Your form should not have two submit buttons. Have the Save button be of type submit, and the Cancel button be of type button.
EDIT: I'm going to update this answer to handle several issues that were brought up.
Nothing I've seen in the HTML specification (i.e. the DTD) disallows two submit buttons in one form, but the exact issue the OP mentioned can occur. In his or her case, the solution is to make the Cancel button of type button and add in the following JavaScript:
<input type="button" value="Cancel" onclick="window.location.href='nextpage.html';"/>
Here, one would replace nextpage.html with the appropriate URL. Or, this.form.action can be the new location if the redirection is to the action of the form.
If the OP wants to be safe and avoid JavaScript, this could only be a (perhaps styled) hyperlink.