By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,724 Members | 1,655 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,724 IT Pros & Developers. It's quick & easy.

Dynamic generation of action string?

P: n/a
Hi,
I have a HTML form and need to generate the action-string (what to do
after submission) from values of textfields in the form. It means
something like
<form method="post" action=whatToDo.value>
<input name="whatToDo" value="http:\www.myPage.com\cgi-bin\DoDefault">
....
</form>

It seems some error is there - don't you know how to make it
functional?

Martin
Jul 20 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
mr****@compik.fd.cvut.cz (Martin Mrazek) wrote:
I have a HTML form and need to generate the action-string (what to do
after submission) from values of textfields in the form. It means
something like

<form method="post" action=whatToDo.value>
<input name="whatToDo" value="http:\www.myPage.com\cgi-bin\DoDefault">
...
</form>

It seems some error is there - don't you know how to make it
functional?


You could do it with JavaScript, but a better idea (i.e. one that will
always work) would be to submit to a single script on that server and
have that script exmaine the relevant input and pass the rest of the
inputs onto the relevant other scripts.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 20 '05 #2

P: n/a
Martin Mrazek wrote:
Hi,
I have a HTML form and need to generate the action-string (what to do
after submission) from values of textfields in the form. It means
something like
<form method="post" action=whatToDo.value>
<input name="whatToDo" value="http:\www.myPage.com\cgi-bin\DoDefault">
...
</form>


You could do it with JavaScript, but this would not work for anyone
with JavaScript disabled or not supported, however this was somewhat
discussed on www-html last February, in the thread "Multiple actions for
forms" [1]. The first response to this, by Mark Birbeck [2], mentioned
that XForms will be able to fulfill this functionality. However, until
XForms is widely implemented in the core functionality (ie. not
requiring a plugin that most people don't have) in the vast majority of,
at least, the popular UAs, then you'll have you use server side processing.

[1] http://lists.w3.org/Archives/Public/...4Feb/0004.html
[2] http://lists.w3.org/Archives/Public/...4Feb/0005.html
--
Lachlan Hunt
http://www.lachy.id.au/
la**********@lachy.id.au.update.virus.scanners

Remove .update.virus.scanners to email me,
NO SPAM and NO VIRUSES!!!
Jul 20 '05 #3

P: n/a
On Sun, 6 Jun 2004, Martin Mrazek wrote:
I have a HTML form and need to generate the action-string (what to do
after submission) from values of textfields in the form.
I'd recommend reviewing that supposed "need", because the WWW isn't
ready to fulfil it for you. Why can't you handle all the requests
with a single server-side script, and resolve any further details
behind that? It's the usual way that people successfully address this
kind of requirement.
It means something like

<form method="post" action=whatToDo.value>
<input name="whatToDo" value="http:\www.myPage.com\cgi-bin\DoDefault">


Does it, really? If your own bogosity alarms don't trigger on seeing
backslashes in an http: URL, then there seems to be a problem.
Jul 20 '05 #4

P: n/a
On Sun, 6 Jun 2004, Martin Mrazek wrote:
I have a HTML form and need to generate the action-string (what to do
after submission) from values of textfields in the form. It means
something like
<form method="post" action=whatToDo.value>
<input name="whatToDo" value="http:\www.myPage.com\cgi-bin\DoDefault"> ^
I don't know if that was a typo - should be "http://www.myPage.com/cgi-...."
Only 1 slash and of the wrong type.
...
</form>

It seems some error is there - don't you know how to make it
functional?

Jul 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.