How to handle the button in the online form example?

50 views
Skip to first unread message

yongzh...@gmail.com

unread,
Apr 7, 2015, 6:20:07 PM4/7/15
to we...@googlegroups.com
Hello all,

We can see a "Submit Query" button if we follow the online instruction (http://webpy.org/form). It is NOT defined by HTML such as

<button id="myBtn">Submit Query</button>

therefore I don't know its id. In my code, I may need the id so that I could use javascript to disable it when there is such a need.

document.getElementById("myBtn").disabled = true;

For me, this button's property is hidden in the form. How can we handle it? Thanks a lot.

Best Regards,
-Yongzhi

Christophe

unread,
Apr 8, 2015, 2:02:05 AM4/8/15
to we...@googlegroups.com
Hello Yongzhi,

in the example, the template contains this:
$def with (form)

<form name="main" method="post">
$if not form.valid: <p class="error">Try again, AmeriCAN:</p>
$:form.render()
<input type="submit" />    </form> # I put the button in bold
Have you tried to give this input an id ? ( for example <input id="myBtn" type="submit" /> )

Regards,

Christophe.
--
You received this message because you are subscribed to the Google Groups "web.py" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webpy+un...@googlegroups.com.
To post to this group, send email to we...@googlegroups.com.
Visit this group at http://groups.google.com/group/webpy.
For more options, visit https://groups.google.com/d/optout.

yongzh...@gmail.com

unread,
Apr 8, 2015, 2:27:39 PM4/8/15
to we...@googlegroups.com
Hello Christophe,

This is exactly what I want. Thank you so much for your help!

Best Regards,
-Yongzhi
Reply all
Reply to author
Forward
0 new messages