/    Sign up×
Community /Pin to ProfileBookmark

Can you submit this form?

Code bellow is copied from a php pack, I change it to html file:

[CODE]<style>
a.button
{
margin: 10px;
color: #FFF;
padding: 10px;
background: #000;
border-radius: 10px;
}
</style>

<div>
<a onclick=”$(‘#myform’).submit();” class=”button”>Save</a>
<a onclick=”location = ‘to/cancel.htm’;” class=”button”>Cancel</a>
</div>

<form action=”to/save.htm” method=”post” id=”myform”>
</form>
[/CODE]

Following line can’t be changed, because it relates too many things in the php pack.

[CODE]<a onclick=”$(‘#myform’).submit();” class=”button”>Save</a>[/CODE]

Button ‘Cancel’ works fine, but button ‘Save’ doesn’t.

Can you make button ‘Save’ to submit form of ‘myform’?

to post a comment
HTML

2 Comments(s)

Copy linkTweet thisAlerts:
@holyhttpMay 10.2012 — First make sure the jQuery script is present in your HTML markup for this $('#myform').submit(); to work;
Copy linkTweet thisAlerts:
@KorMay 11.2012 — Are you warned that the code used is JQuery Framework, not native JavaScript? Do you know what a JavaScript Framework is? Do you know JavaScript, after all?
×

Success!

Help @html20009876 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.3,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...