/    Sign up×
Community /Pin to ProfileBookmark

Button To Fill-in a Form box?

Html is not my gig but it is yours. Here is the problem My wife has a site for classes at school to use([url]http://www.fcat8mathreview.com)[/url]. I use a form on a comments page for people to submit comments about the students projects. I was wondering if there is a code for giving each projects button that when it is pushed it will fill in on the form which project it came from. This is be great to know consisdering that there are about 100 of these projects coming before Christmas.

Thanks,
Shaun

[url]http://www.fcat8mathreview.com/[/url]

to post a comment
HTML

2 Comments(s)

Copy linkTweet thisAlerts:
@FangDec 06.2007 — Not with html. A server side language solution is required for correct processing.

JavaScript can be used at a pinch, but will not work for all users.
Copy linkTweet thisAlerts:
@nap0leonDec 10.2007 — If you are allowed to use JavaScript (e.g., Your website requires JavaScript be enabled), have the "Post Comments" link call a javascript function when it is clicked. Use that function to update the value of "hiddenField" and then submit the form.

[CODE]
<p><input type="hidden" name="hiddenField" value"" /><a onClick="SubmitMe();">Post Comments</a></p>

<script>
function SubmitMe(){
document.forms['form1'].hiddenField.value = 'ProjectName';
document.forms['form1'].submit();
}
</script>
[/CODE]
×

Success!

Help @shaunrranger 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.18,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

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