This topic is locked
[SOLVED]

 Togle from View to Edit

8/30/2012 6:57:13 PM
PHPRunner General questions
K
kenlyle author

I need to make a button on the View Contacts page to call the same Contact, but in Edit view.
I've looked at a lot of forum entries, but none seems to exactly cover this, and many user header() which only works on page load, and the page is already well loaded.
Best,

Ken

P
procheck 8/30/2012

Hi Ken,
Have you tried javascript?
ie
?>

<script>

window.location = "pagename.php";

</script>

<?php
Al

G
gdmacdo 8/31/2012

I use ASPRunner but I believe this code could help. I create a button on the view page:
Try the following in ClientBefore event:
var regexS = "[\\?&]editid1=([^&#]*)";

var regex = new RegExp( regexS );

var results = regex.exec( window.location.href );

window.location.href="Parent_Invite_Spanish_edit.asp?editid1=" + results[1];



I need to make a button on the View Contacts page to call the same Contact, but in Edit view.
I've looked at a lot of forum entries, but none seems to exactly cover this, and many user header() which only works on page load, and the page is already well loaded.
Best,

Ken

K
kenlyle author 8/31/2012

Thanks, guys! Here's how I solved it, and it seems the most straightforward.
Make a snippet with global $data and build the target URL with the . $data["id"]

Stick the button code into the HTML view of your page, like <INPUT TYPE="BUTTON" VALUE="Edit" ONCLICK="window.location.href='{$event your_snippet4}'">
Build and enjoy!