Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re^2: Form Action

by Zcity (Novice)
on Jul 03, 2006 at 12:55 UTC ( #558987=note: print w/replies, xml ) Need Help??

in reply to Re: Form Action
in thread Form Action

Thanks to All for the help. Anyways, i got it to work by doing this:

print "Content-type: text/html\n\n"; print "<HTML>\n"; print "<HEAD>\n"; print "<TITLE>Forum</TITLE>\n"; print "</HEAD>\n"; print "<BODY>\n"; print "<FORM METHOD=POST>\n"; print "<INPUT TYPE='submit' VALUE='Preview' name='preview' onClick=thi +s.form.action='preview.cgi';''>\n"; print "<INPUT TYPE='submit' VALUE='Submit Reply' name='reply' onClick= +this.form.action='createreply.cgi';''><br>\n"; print "</FORM>\n"; print "</BODY>\n"; print "</HTML>\n";

Code tags added by GrandFather

Replies are listed 'Best First'.
Re^3: Form Action
by davidrw (Prior) on Jul 03, 2006 at 19:55 UTC
    using here-docs will make that output code cleaner and resolve some quoting issues (your onClick values will be problematic as-is)...
    print <<EOF; Content-type: text/html <HTML> <HEAD> <TITLE>Forum</TITLE> </HEAD> <BODY> <FORM METHOD="POST"> <INPUT TYPE="submit" VALUE="Preview" name="preview" onClick=" +rm.action='preview.cgi';''"> <INPUT TYPE="submit" VALUE="Submit Reply" name="reply" onClick="this +.form.action='createreply.cgi';''"> </FORM> </BODY> </HTML>
    or, using CGI:
    print header, start_html( -title => 'forum' ), start_form( -method => 'POST' ), submit( -name => 'preview', -value=>'Preview', -onClick => "this.for +m.action='preview.cgi';''" ), submit( -name => 'reply', -value=>'Submit Reply', -onClick => "this. +form.action='createreply.cgi';''" ), end_form, end_html, ;

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://558987]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (12)
As of 2018-03-22 13:09 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (274 votes). Check out past polls.