Forum Moderators: open

Message Too Old, No Replies

Need help with XForms

Need a simple XForms button

         

twist

4:19 am on Jan 24, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I did a search for XForms on this forum and only got 1 result which only mentioned it in a list of xml languages. So I am happy to post the first XForms question :)

First off, what browsers even support XForms? Is there alternatives?

This is what I have for my html form,

<form>
<input type="button" value="Agree" onClick="location.href='admit.html'">
<input type="button" value="Disagree" onClick="location.href='deny.html'">
</form>

Just 2 buttons that redirect the user when pushed.

I went to this w3 tutorial [w3.org] and have looked over the button section but can't seem to get it right.

I added this to the html tag,

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://www.w3.org/2002/xforms" xmlns:ev="http://www.w3.org/2001/xml-events">

I added this to the head,

<f:model>
<f:submission action="http://example.com/home.php" method="get" id="s"/>
</f:model>

I added this to the body,

<f:trigger>
<f:label>Agree</f:label>
<f:script ev:event="DOMActivate" type="text/javascript"><!-- onClick="location.href='agree.html'"; --></f:script>
</f:trigger>

It only prints out the text Agree, no button.

Any help will be much appreciated.

[edited by: Woz at 4:41 am (utc) on Jan. 24, 2004]
[edit reason] examplified code [/edit]

twist

4:36 am on Jan 24, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Umm... XForms don't work with any of the browsers yet do they, argh. Opera almost worked but IE and Moz flopped. So, does anybody know a way to add form buttons and keep your page xhtml 1.1 compliant?

*edit* nevermind, found this thread [webmasterworld.com...]

I'm still having a problem though. It's giving me a error on the onClick word?

<input type="button" value="Disagree" onClick="location.href='home.php'" />

Any thoughts?

*another edit* nevermind again, just had to change it to onclick instead of onClick