×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Copy & Pasting Forms within same page

Copy & Pasting Forms within same page

Copy & Pasting Forms within same page

(OP)
Ok, FrontPage has decided to try to be helpful - when I don't want it to be (never liked FP, but job requires using it).

I have a program that generates a form for me, that contains 2 hidden fields and a submit button.  It generates the form and copies it to the clipboard in a manner that allows it to be pasted into FP.

Here is an example form:

CODE

<form method="post" action="http://some_processor.php">
   <input type="hidden" value="m_id" name="merchant">
   <input type="submit" value="Quick Buy">
   <input type="hidden" name="sku" value="T013201">
</form>

The first form placed on the page works just fine, but subsequent forms fail to work properly (target script reports problem).

I have found out that FP - while trying to be helpful, renames the merchant and sku fields - to keep unique names.

The target script is dependent on the merchant and sku fields being named properly, but the subsequent ones are name merchant# and sku# (where # represents a number).

I can understand renaming if the field were within a form that already had that field name, but a separate form on the same page should allow that (just IDs that are separate).

Anyone know how to turn this "helpfulness" off?

RE: Copy & Pasting Forms within same page

It may be that this method has to be used but would it not be easier to just create a 'graphic' link to the PHP script containing the 'sku' value and paste that into your page? The correct merchant values could be assigned within the script itself?

Keith
www.studiosoft.co.uk

RE: Copy & Pasting Forms within same page

(OP)
The merchant values cannot be assigned within the script itself, as the script handles multiple merchants (thus different price levels for the items) - so the merchant id must be passed to the script.

Actually the script requires https so passing the values as a link (via GET method), would leave it vulerable - though there isn't much vulnerable at that point in the script.

That might be the way to go - however, if there is a way to turn that "feature" off - that would be easiest at this point.

RE: Copy & Pasting Forms within same page

Not sure if it can be turned off but it makes sense that this feature is in place.
If there are only a small number of merchants, you could pass a merchant code to the script rather than the merchant number itself. If you are pulling data from a DB, the merchant number could be accessed that way.
As regards security, the merchant number will be viewable in the page source code if you use your original method.
Another thought, if you go down the form route, you could iterate through a loop which creates all the possible values of merchant and sku numbers and find the ones which contain data. It's a bit messy but would provide a solution.
Perhaps you could explain why you need to use Frontpage as personally, I would be serving the pages from the PHP script directly.

Keith
www.studiosoft.co.uk

RE: Copy & Pasting Forms within same page

(OP)
Yea, I'll probably end up passing the values via GET links.

I HAVE to use FrontPage, because the boss likes to edit the website - and that's all he know how to use.

Personally, I would serve up the pages from the PHP script as well.

RE: Copy & Pasting Forms within same page

Makes it harder when someone wants to change the structure but as you say, he is the boss!
I often think their time would be better spent running their businesses but ho hum.
Why not let him edit a single htm form and use that as a template for the rest of the site. he controls layout and you can have a hassle free application.

Keith
www.studiosoft.co.uk

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close