> > On Jan 18, 9:46 am, goll <[email protected]> wrote: >> Hi, >> >> I'm rather new to iui, but I already have made my fist successful >> steps. However, I'm stuck now with a problem with forms. I'm using non- >> ajax forms that load a new page. > > I don't use iUI, it seems you shouldn't be either (for this at least).
Using iUI here provides Rob to use all the graphics out-of-the-box. > > >> My form looks like this: >> <form id="someid" title="Item" class="panel" method="post" >> action="index.php"> >> <h2>...</h2> >> <fieldset> >> ... >> </fieldset> >> >> <input type='submit' name='s1' value='s1' /> >> <input type='submit' name='s2' value='s2' /> >> <a class="whiteButton" type="submit" name='a1'>a1</a> >> <a class="whiteButton" type="submit" name='a2'>a2</a> > > You should use inputs for submit buttons, not A elements. That way, > only the one that is clicked on will be succssful and it will be the > only one sent to the server. > > The type attribute should not be used this way - it is intended as a > hint to the browser regarding the content (MIME) type that will be > returned by a link. If the browser doesn't understand the type, it may > ignore the link. > > I suppose iUI wants it that way - regardless, it is bad design. > Agree on that :) > >> </form> >> >> A form with 4 buttons is displayed. The problem is that independently >> of what button I click, I always get the same POST parameters in >> index.php: >> [s1] => s1 >> [s2] => s2 > > You should only get s1 or s2 (or a1 or a2 if they are made submit > buttons), depending on which button is clicked. > > >> So it is impossible to find out in index.php which button has been >> cklicked. > > Likely because the wrong data is being sent to it. > > >> What am I doing wrong? > > Using script where a plain form would be better? :-) > Agree here too :) But you can use a link tag using <a class="whiteButton" onclick="form.submit()">Submit</a> if adding name="form" to the <form> Remi > > -- > Rob > -- > 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. > >
-- 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.
