-
20 Nov 2006 4:40 PM #1
Basic Dialog and form submit
Basic Dialog and form submit
Hi Folks,
I am trying to wrap a form around a basic dialog so that when the user clicks the submit button the form is submitted as per it's defined action. The following is my code, I am pretty new to this stuff but I have a feeling I am being very optimistic thinking this code would work. What I was hoping is that the 'runprogram.php' would be called, but it doesn't appear to be.
Code:var SubmitForm = function() { var tform = getEl('test'); tform.submit; // vardiaProgram.hide(); }; function init (){ vardiaProgram = new YAHOO.ext.BasicDialog("diaProgram", {modal:true,autoTabs:true,width:500,height:300,shadow:true,minWidth:300,minHeight:300 }); vardiaProgram.addButton('Submit', SubmitForm); vardiaProgram.show(); } YAHOO.util.Event.addListener(window, "load", init); </script> <body> <form id="test" method="POST" action="http://localhost/jc/php/runprogram.php"> <div id="diaProgram" style=";visibility:hidden"> <div class="ydlg-hd">Add Dialog</div> <div class="ydlg-bd"> <label for="fldField1"> Enter this:</label> <input id="fldField1" /> </div> <div class="ydlg-ft"></div> </div> </form>
TIA,
JC
-
20 Nov 2006 5:07 PM #2
tform.submit <- missing parens ???
Tim Ryan
Read BEFORE posting a question / BEFORE posting a Bug
Use Google to Search - API / Forum
API Doc (4.x | 3.x | 2.x | 1.x) / FAQ / 1.x->2.x Migration Guide / 2.x->3.x Migration Guide
-
20 Nov 2006 5:48 PM #3
Thanks for the reply,
but I already tried that and I get an "object does not support this property or method" error.
-
20 Nov 2006 8:21 PM #4
Well since you coded tform.submit, my first thought would have been that you read the docs/looked at the source code and found a (new) function that was added to the library. Since adding parens says that there is no function called submit, at least I know that I miss a new addition to the library.
I would suggest you search the forums for examples using UpdateManager which is one way to make a call to another page. Or, you could just use the base yui methods in the Connection class to do a request. I don't have the code in front of me know - I think the method is asyncRequestTim Ryan
Read BEFORE posting a question / BEFORE posting a Bug
Use Google to Search - API / Forum
API Doc (4.x | 3.x | 2.x | 1.x) / FAQ / 1.x->2.x Migration Guide / 2.x->3.x Migration Guide
-
20 Nov 2006 10:43 PM #5
resolved
resolved
Thanks for your help Tim,
As you suggested I used the Yahoo connection class to get this working
(http://www.yui-ext.com/forum/viewtop...=dialog+submit)
JC
-
21 Nov 2006 12:44 AM #6
tform.dom.submit()
getEl() returns a YAHOO.ext.Element
Similar Threads
-
how to submit a form split over several tabs?
By raphinou in forum Ext 1.x: Help & DiscussionReplies: 4Last Post: 1 Jun 2007, 7:20 AM -
ID of submit within form masks submit function
By aconran in forum Ext 1.x: Help & DiscussionReplies: 1Last Post: 19 Feb 2007, 12:08 AM -
Basic Dialog Form plus submit example?
By rob30UK in forum Ext 1.x: Help & DiscussionReplies: 26Last Post: 13 Jan 2007, 9:11 AM -
BasicDialog: how to submit a form without AJAX.
By moraes in forum Ext 1.x: Help & DiscussionReplies: 4Last Post: 5 Jan 2007, 7:02 AM -
BasicDialog with one TabPanelItem a try to submit form
By JuanParraC in forum Ext 1.x: Help & DiscussionReplies: 5Last Post: 4 Dec 2006, 12:15 AM


Reply With Quote