How can I create a new object using a hypertext link instead of a button?

How can I create a new object using a hypertext link instead of a button?

Tuesday 27 May 2003 11:02:19 am - 3 replies

Author Message

Stuart Fenton

Wednesday 25 June 2003 5:46:53 am

So is this a "no way can this be possible, you must be out of your head" scenario.

Just wonderig since I have had no reply in a while and I am sure you all have experieced the same problem.

Has anyone else found a better way of doing this or am I just stupid.

Your help would help me.

The issue is basically that in order to allow a user to admin their own account I can point them to their own user account and after that I can show relational content for them to fill in. I can relate all the objects needed for them under their account without having to list items based upon user id. Which i EZ you cannot do.

So as a better idea I can get them logging in and then present them with their account details. When their details are missing the icon still looks the same (edit or new) but it does a different function. It creates them beacause they are missing.

How can I achive this?

Any idea are greatfully received.

I will let you know how I get on with, I think, is a basic requirment for all webmasters.

Fats.

-- Stuart

stuart@grandmore.com
http://www.grandmore.com

Selmah Maxim

Wednesday 25 June 2003 6:18:29 am

Hi ..

Try this, make the form normally, but the input types hidden then .. :

<form name="Test" ... >
<input type=hidden value="some value">
</form>
<a href="#" onclick="window.document.Test.submit();">Link</a>

Stuart Fenton

Wednesday 02 July 2003 3:21:27 am

Thanks for your reply.

Sorry for the delay in replying but I was porting my work over to ez3.1 and setting up a Linux box which I hadn't done before so it took me a lot of time.

I have been trying to get the code to work and it does after a fashion but it seems that it is not posting the variables at the same time. I am trying to get the href to post the submit for creating a new object. This gets passed to the "action" event within ez. It does submit but is does not properly pass all the variables to correctly create the object.

Here is the code.

<form name="new_address" method="post" action={"content/action"|ezurl}>
<input type="hidden" name="NodeID" value="{$node.node_id}" />
<input type="hidden" name="ContentObjectID" value="{$content_object.id}" />
<input type="hidden" name="ClassID" value="9" />
</form>
<a href="#" onclick="window.document.new_address.submit();">Create Address Details</a>

Am I doing something obviously wrong?

Your help would be appreciated.

Fats.

-- Stuart

stuart@grandmore.com
http://www.grandmore.com

You must be logged in to post messages in this topic!

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.