Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > form submission to two pages (Perl, CGI, JavaScript)

Reply
Thread Tools

form submission to two pages (Perl, CGI, JavaScript)

 
 
ccc31807
Guest
Posts: n/a
 
      12-17-2012
I have a rather long list, perhaps named 'list_presidents' that allows users to update single records. It might look like this, with the convention that [[input text][submit N]] is an HTML form:

1 | George Washington | [[input text][submit 1]]
2 | John Adams | [[input text][submit 2]]
3 | Thomas Jefferson | [[input text][submit 3]]
4 | James Madison | [[input text][submit 4]]

The form field looks like this:
<form method="post" action="update_pres" name="pres_N">
....
<input type="submit" value="Update President N" />
</form>

I would like to do one of three things but quite frankly don't know how. This post is the culmination of a fairly long time flailing around, and I'd like a little help --- even if it's confirmation that what I want is not possible (which I'm beginning to suspect is the case.)

1. When the user clicks on the submit button, leave the user on the same page but execute a script in the background that updates the underlying database.

2. When the user clicks on the submit button, leave the user on the same page but open a new page that confirms that the database has been updated.

3. When the user clicks on the submit button, go to a new page that confirms the update but then immediately returns to the prior page.

The problem is that the table has about 40,000 records, and there are aboutsix filters, some of which have fifty or so options, and they all can be multiply selected. It was a lot faster and simpler when I had just a couple of thousand records and a couple of simple filters, but this has grown froma sweet innocent baby to a strapping adult man, and I need some help with it.

Thanks, CC.

 
Reply With Quote
 
 
 
 
J. Gleixner
Guest
Posts: n/a
 
      12-17-2012
On 12/17/12 13:24, ccc31807 wrote:
> I have a rather long list, perhaps named 'list_presidents' that allows users to update single records. It might look like this, with the convention that [[input text][submit N]] is an HTML form:
>
> 1 | George Washington | [[input text][submit 1]]
> 2 | John Adams | [[input text][submit 2]]
> 3 | Thomas Jefferson | [[input text][submit 3]]
> 4 | James Madison | [[input text][submit 4]]
>
> The form field looks like this:
> <form method="post" action="update_pres" name="pres_N">
> ...
> <input type="submit" value="Update President N" />
> </form>
>
> I would like to do one of three things but quite frankly don't know how. [...]>


None of these really has anything to do with Perl/server side...

> 1. When the user clicks on the submit button, leave the user on the same page but execute a script in the background that updates the underlying database.
>
> 2. When the user clicks on the submit button, leave the user on the same page but open a new page that confirms that the database has been updated.
>
> 3. When the user clicks on the submit button, go to a new page that confirms the update but then immediately returns to the prior page.
>

That last one and it would make for a poor user experience.

Read up on AJAX. A JavaScript framework, like JQuery, makes doing these
things much easier than writing it yourself. There are many JavaScript
libraries that you can choose from and they each simplify AJAX calls,
going through the DOM, validating forms, dynamically show/hide
elements, etc. Other popular libs: Ext JS, MooTools, Prototype,
GWT, YUI, etc....

See: http://en.wikipedia.org/wiki/Compari...ipt_frameworks
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
1 Link opening 2 pages in two iframes each on different seperate pages More options SHC Javascript 6 03-29-2007 05:12 PM
1 Link opening 2 pages in two iframes each on different seperate pages SHC HTML 0 03-28-2007 07:08 PM
ECCOMAS VipIMAGE 2007 - Abstracts Submission Period Extended in TWO WEEKS tavares@fe.up.pt Python 0 03-17-2007 10:24 AM
(onetime) Form Submission Leon Shaw ASP .Net 1 08-15-2003 03:15 AM
Form Submission: Final URL that has form options included ?? Jared Javascript 5 07-10-2003 10:33 AM



Advertisments