Visit Our UNIX and Linux User Community


perl cgi form action target


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting perl cgi form action target
# 1  
Old 12-06-2007
perl cgi form action target

Hello All,

I was trying to come up with a form using perl cgi. I then created a frame to show the output of the form. Refer below

print $display_form->start_form(-title=>"Updateuser", -style => 'font-size: 9pt; color: #202020 ; font-family: Verdana', action=>"${DOCROOT}updateUser.pl", target=>'cmxiframe');

print $display_form->end_form();

print $display_form->Tr(
td(
{
-width => "70%",
-halign => "right",
-valign => "top" },
"<iframe id=\"cmxiframe\" name=\"cmxiframe\" src=\"${DOCROOT}blankPage.pl\" width=600 height=200 frameborder=0 scrolling=no style=\"overflow:visible\"></iframe>"
)


However, this is not redirecting the output of my 'action' scipt into the required frame. Does anyone see a problem here ? Thanks in advance.

Regards,
Garric
# 2  
Old 12-06-2007
Quote:
Originally Posted by garric
print $display_form->start_form(-title=>"Updateuser", -style => 'font-size: 9pt; color: #202020 ; font-family: Verdana', -action=>"${DOCROOT}updateUser.pl", -target=>'cmxiframe');
Some hyphens appear to be missing on this line.
# 3  
Old 12-06-2007
Even after adding the hyphens, it continues to take me to a new page and is not loading it in the frame Smilie
# 4  
Old 12-06-2007
Have you checked the generated HTML (use browser's view source) really contains the "form" tag with the target attribute and the iframe is really there with that name?

As the CGI module does nothing but generates HTML, it should be reproducible with a static HTML form with the same HTML.
# 5  
Old 12-09-2007
The HTML looks right. Its here below

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US"><head><title>Untitled Document</title>
<meta http-equiv="refresh" content="300" />
</head><body><form method="post" action="/CSDADM/updateUser.pl" enctype="application/x-www-form-urlencoded" target="cmxiframe" style="font-size: 9pt; color: #202020 ; font-family: Verdana" title="Updateuser">
&nbsp;&nbsp;<p /><p /><p /><b>Choose pool : </b>&nbsp;<select name="pool">
<option value=""></option>

<option value="ipf_64g">ipf_64g</option>
<option value="md_alt">md_alt</option>
<option value="md_pnr">md_pnr</option>
<option value="rls">rls</option>
<option value="vesta">vesta</option>
</select>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<p /><b>Enter User &nbsp; : </b>&nbsp;<textarea name="user" rows="1" cols="15" style="background-color: transparent">hkn</textarea>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<p /><b>Choose operation : </b><input type="radio" name="operation" value="add " checked="checked" />add <input type="radio" name="operation" value=" remove" /> remove<p /><input type="submit" name="Update user" value="Update user" /><div><input type="hidden" name=".cgifields" value="operation" /></div></form><table border="0" cellspacing="0" cellpadding="0" width="70%"><tr><td valign="top" halign="right" width="70%"><iframe id="cmxiframe" name="cmxiframe" src="/CSDADM/blankPage.pl" width=600 height=200 frameborder=0 scrolling=no style="overflow:visible"></iframe></td></tr></table></body></html></body></html>

Previous Thread | Next Thread
Test Your Knowledge in Computers #78
Difficulty: Easy
Linux was inspired by MINIX
True or False?

10 More Discussions You Might Find Interesting

1. OS X (Apple)

Perl CGI

I am trying to get my MacBook Pro with 10.8 Mt Lion set up to run Perl CGI scripts. Having a problem. I can start Apache Web Server with no problems. Why do I put the static and dynamic scripts? I which directory? I have looked at this article:... (3 Replies)
Discussion started by: djehresmann
3 Replies

2. Shell Programming and Scripting

Cgi to dump xml data from form input field

Hi All, I am trying to write a shell script which takes parse the web form find the input field and dump the data of that field into one xml file. The form looks like, <input type="button" id="btnSave" value="Save" onclick="saveXmlData()"/> <form name="submitForm"... (1 Reply)
Discussion started by: jdp
1 Replies

3. Shell Programming and Scripting

CGI Perl : while loop in CGI perl

Hi Team, I am trying to connect to database(succeeded ) and print the records on the browser using while loop. But the elements of array are not displayed instead while loop is displayed directly. Instead of the below I can embed html statements in print but I am looking for the below style as I... (1 Reply)
Discussion started by: scriptscript
1 Replies

4. Shell Programming and Scripting

Perl CGI : unable to download the excel sheet from perl cgi page

Hi All, I have written an cgi perl script that displays an image(Excel image) and when clicked on that Image I need to download a excel sheet. I made sure that excel sheet exists in the folder with the given name but still I am not able to download the sheet. print "<center><table... (2 Replies)
Discussion started by: scriptscript
2 Replies

5. Shell Programming and Scripting

Perl cgi pages out of cgi-bin folder in WINDOWS

Hi team, I have a typical problem with cgi pages in apache webserver in WINDOWS I am able to execute(display) the pages that are saved in cgi-bin folder. But I am not able to execute the pages stored in htdocs or other folder other than cgi-bin folder. Could anyone please let me know how... (1 Reply)
Discussion started by: scriptscript
1 Replies

6. Shell Programming and Scripting

Perform an action if certain text exist in output (PERL)

Hello, I'm attempting to write a tool that checks an IP address for existing PTR records then if there are no PTR records does a ping to see if it response. Then if there is no response, it should print a message saying This is what I have so far. #!/usr/bin/perl $nxdomain =... (4 Replies)
Discussion started by: spartan22
4 Replies

7. Web Development

problem with exporting vairable from one perl cgi to another perl cgi script while redirecting.

Can anyone tell me how to export a variable from one perl CGI script to another perl cgi script when using a redirect. Upon running the login.pl the user is prompted to enter user name and password. Upon entering the correct credentials (admin/admin) the user is redirected to welcome page. My... (3 Replies)
Discussion started by: Arun_Linux
3 Replies

8. Shell Programming and Scripting

Perl: One action if an element doesn't exist in array

Hello, I want to run one (not multiple) action if an element doesn't exist in array. for example: @array = (1..10); foreach $el (@array) { if ($el != 11) { print "number not found\n"; } } the output of this simple script: number not found (3 Replies)
Discussion started by: ahmed_zaher
3 Replies

9. Web Development

in cgi perl script a form

hi,i hav a form in cgi perl script.this script accepts a value from user from another html form, and depending upon this value,i need to disable /enable radio buttons in cgi-perl script wen second page is displayed on executing cgi perl script.how do i do it using javascript? (0 Replies)
Discussion started by: raksha.s
0 Replies

10. Shell Programming and Scripting

HTML form to cgi help

I wrote a script to automate user account verification against peoplesoft. Now I want to make it available to my peers via the web. It is running on Solaris. I have the form written, but am not sure how to make it work. I think the form should call a perl cgi when submitted. The cgi should call... (7 Replies)
Discussion started by: 98_1LE
7 Replies

Featured Tech Videos