Hi Fibo!

Please check http://we-are-gurus.com/labs/iui/sandbox/php-form/ and tell me
if it's what you're trying to do (more or less)
index.php has a list + a form.
form.php deals with datas and renders an iUI screen based on what you have
submitted.
(leave blank to see error panel)

This is what i have in index.php

* <form id="form" title="My form" method="POST" action="form.php"
name="myform" class="panel">*

* <h2>My form</h2>*

* <fieldset>*

* <div class="row">*
* <label id="text">First name</label>*
* <input type="text" name="firstname" placeholder="Your firstname">*
* </div>*

* <div class="row">*
* <label id="text">Last name</label>*
* <input type="text" name="lastname" placeholder="Your lastname">*
* </div>*

* <div class="row">*
* <label>Select a fruit</label>*
* <select name="fruit" size="1">*
* <option value="value1">Apple</option>*
* <option value="value2">Banana</option>*
* <option value="value3">Pineapple</option>*
* <option value="value3">Strawberry</option>*
* </select>*
* </div>*

* <div class="row">*
* <label>Number of fruits</label>*
* <select name="fruit_num" size="1">*
* <?php for($i=1;$i<10;$i++) { ?>*
* <option value="<?php echo $i ?>"><?php echo $i ?></option>*
* <?php } ?>*
* </select>*
* </div>*

* </fieldset>*

* <a href="#" type="submit" class="whiteButton">Submit form</a>*

* </form>*


And this is what form.php looks like:

*<?php*
*$num = intval($_POST['fruit_num']);*
*?><div id="result" title="Result" class="panel">*
* <h2>Form result</h2>*
* <fieldset>*
* <?php*
* if(!empty($_POST['firstname']) && !empty($_POST['lastname']))*
* { ?>*
* <div class="row" style="text-align: left">*
* <p>*
* Welcome <?php echo $_POST['firstname'].' '.$_POST['lastname'] ?>!*
* </p>*
* </div>*
* <div class="row" style="text-align: left">*
* <p>*
* You asked for <?php *
* if($num<=1)*
* echo $num.' '.$_POST['fruit'];*
* else*
* echo $num.' '.$_POST['fruit'].'s';*
* ?>*
* </p>*
* </div>*
* <?php } else { ?>*
* <div class="row" style="text-align: left">*
* <p>*
* Please enter your firstname & lastname*
* </p>*
* </div>*
* <?php } ?>*
* </fieldset>*
*
*
* <a href="javascript:history.go(-1)" class="grayButton">Go back</a>*
*
*
*</div>*


Hope this is gonna help you in any way, and keep us posted if you're good
now (or not)


Remi


On Fri, Mar 23, 2012 at 3:32 PM, Fibo <[email protected]> wrote:

> Hi Sean,
>
> Still no help.
>
> What I am trying to do:
> - in my page, main "screen" A goes to form B. This one is defined with
> action: php page C, method post
> - I am submittig the form wit a href submit
> - C.php does correctly its data-handling part, and its html code is pasted
> fine at the end of my page
> - in fact I want this to go autoimatically to main screen A... and I am
> not sure how I should handle that
>
> Something I have done but which does not work: have an html code generated
> by C.php with something like
> <div id="<?php echo date("Hms"); /* handles multiple calls*/ ?>" >
>   <script type="application/x-javascrript">
>       // library iui/jit-loader is loaded in main page
>       iui.showPageById('pageA'); // no # here
>    </script>
> </div>
>
> Since it is enclosed with <div>s, the code is present in the result
> page... but I just get the toolbar and a lower level blank page (oolbar
> button points to screen B
>
> Obviously I'm doing something wrong, but I have made several attempts
> without finding the right way, help welcome!
>
>
>
>
>
> Le mercredi 14 mars 2012 10:26:32 UTC+1, Sean Gilligan a écrit :
>
>> On 3/9/12 2:26 AM, Fibo wrote:
>>
>> > I have some troubles understanding how to use *iui.ajax* or
>> > *iui.showPageByHref, *at least from page
>> > http://www.iui-js.org/​documentation/0.50/iui-​documentation.html<http://www.iui-js.org/documentation/0.50/iui-documentation.html>
>>
>>
>> Sorry nobody has helped you yet.  Have you solved your problem?  Let me
>> know where you're at and I'll try to help you.
>>
>> -- Sean
>>
>>  --
> You received this message because you are subscribed to the Google Groups
> "iPhoneWebDev" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/iphonewebdev/-/2qkdxd-jDCgJ.
>
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/iphonewebdev?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"iPhoneWebDev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/iphonewebdev?hl=en.

Reply via email to