Problems displaying iRev script output in an iFrame

Mike Bonner bonnmike at gmail.com
Fri Aug 13 07:24:52 CDT 2010


You can't use form elements directly in an irev script. Meaning you
can't include them between <?rev and ?>

So for example the line:

put "Thanks for the feedback."<br />
<br />

Just confuses the engine.  Since its within a <rev script tag you nave
to specifically "put" the tags you want, inside quotes as rev expects
things to be. Since the html tags are just text you can do:

put "Thanks for the feedback.<br /> <br />"

If you wanted to do the <br /> seperate, you could do:
put "Thanks for the feedback." & "<br /><br />"

If you need to put several things together, follow normal rev rules.
You do this correctly with your $_POST lines, except for the trailing
"<br />" which should be in quotes.  If it was just <br> it would
probably work because then it would be seen as a single entity, the
engine would try to interpret it as a variable, failing that would
just put out <br>  (I think) but since there is a space between the r
and the / it would see it as 2 separate entities and not know what to
do with the last part.  This is an example of why you should always
quote string output.

The fixed script portion follows:

<?rev

put "Thanks for the feedback.<br /> <br />"
Put "Your information is:<br /><br />"

put "Name:"&& $_post["name"] & "<br /><br />"
put "Age:"&& $_post["age"] & "<br /><br />"
put "Email:"&& $_post["email"] & "<br /><br />"
put "<br />"
Put "We'll be in touch as soon as possible." & "<br />"

?>



On Fri, Aug 13, 2010 at 1:18 AM, Ian McKnight <iangmcknight at gmail.com> wrote:
> Hi
>
> I am experimenting with iRev scripts in my OnRev account and I am
> having difficulty in displaying the required response to data
> retrieved from a web form.
>
> I have two html pages. On one page, the home page, a simple 3 line web
> form is displayed in an iFrame. The form is in an iRev file.
> This page displays correctly.
>
> When the submit button is clicked I want to reproduce the form content
> and some other fixed text inside the same iFrame.
>
> My form action line from the iRev Form file is <form
> action="http://mcknight.on-rev.com/onrevtest/formresponse.irev"
> method="post" name="inlineframe3">
>
> My formResponse.irev script is
>
> <html>
> <body>
> <?rev
>
> put "Thanks for the feedback."<br />
> <br />
> Put "Your information is:"<br />
> <br />
>
> put "Name:"&& $_post["name"] &<br />
> <br />
> put "Age:"&& $_post["age"] &<br />
> <br />
> put "Email:"&& $_post["email"] &<br />
> <br />
>
> <br />
> Put "We'll be in touch as soon as possible." &<br />
>
> ?>
> </body>
> </html>
>
> When I enter data and press submit the iFrame goes blank. However, if
> I rename formresponse.irev to formresponse.html everything after
> 'Thanks for the feedback' including tags is displayed in the iFrame.
> Now I know that the file needs to have an irev extension for the
> script to run but the renaming seems to show that the output is being
> aimed in the right direction - the iframe.
>
> Any tips and advice would be appreciated.
>
> Thanks
>
> --
> Regards
>
>
> Ian McKnight
>
> iangmcknight at gmail.com
> =======================
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>



More information about the use-livecode mailing list