in reply to Re: Re: Assign perl value in html link
in thread Assign perl value in html link

The tricky part is I dont really want to create a separe page for each field because i have over 20 of them.

You can probably get by with a small number of generic edit pages, depending on the type of data you'll be editing. (If everyhing can be editing in a 20 character field, you can use a single edit page).

Here's how it works: You already have a form that contains some number of visible and invisible fields. Add alternate "Submit" buttons labeled "Edit". Give these buttons the name of the field you want to edit (or some name from which the target field name can be derived).

When one of these buttons is pressed, it submits the form. The CGI that catches the submit needs to recognize that an edit button was pressed (as opposed to an "I'm done with this page" button), and respond by producing an HTML page that includes a form. The form has an edit field for the field being editing, and all other form values hidden. The form action for this page is a CGI that handles the edit, and redirects back to something that will regenerate the page you started out on (e.g., your "confirmation" page).

  • Comment on Re: Re: Re: Assign perl value in html link

Replies are listed 'Best First'.
Re: Re: Re: Re: Assign perl value in html link
by Anonymous Monk on Oct 04, 2002 at 20:07 UTC
    So there's no way I could write in JavaScript something like that to make it work?
    <a href="javascript:edit=formname.company">