Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Need help in submitting a DynamicForm programmatically?

    I am trying to create a hidden form with some data, which needs to be submitted to a jsp page (gets open in a new window), but all this needs to happen programatically, without user pressing submit button.

    My Sample code
    Code:
    var fsquery = "abcd";
    var emailId = "as@gmail.com";
    var portalPsswd = "password";
    var projectId = "123";
    var kbUrl = "some url which will consume form post parameters";
    var pv="1.2",pn="ADA";
    
    this.kbform=isc.DynamicForm.create({
    width: 300,
    fields: [
    {type: "hiddenitem", name: "EMAIL_ID", defaultValue:emailId },
    {type: "hiddenitem", name: "PORTAL_PASSWORD", defaultValue:portalPsswd},
    {type: "hiddenitem", name: "PROJECT_ID", defaultValue:projectId},
    {type: "hiddenitem", name: "FSQUERY", defaultValue:fsquery},
    {type: "hiddenitem", name: "PRODUCT_VERSION", defaultValue:pv},
    {type: "hiddenitem", name: "PRODUCT_NAME", defaultValue:pn},
    {type: "hiddenitem", name: "ORIGIN", defaultValue:"Administrator"},
    {type: "submit", name: "submit", defaultValue: "submit"}
    ],
    action: kbUrl,
    target: "_blank",
    method: "POST",
    canSubmit: true
    });
    
    this.kbform.submit();
    the last statement does not submit the form automatically, but if I click the submit button provided, it works perfectly as needed.


    Update
    I am trying the above code replacing the "kbUrl" with a internal url here, http://smartclient.com/index.jsp#textItem
    The submit button click opens a new window and does exactly what is expected, but please provide me a solution which will help me simulate "submit" type button functionality to submit the form.
    Last edited by abhisheksimion; 1 Apr 2013, 02:21. Reason: added code tag

    #2
    Please help

    The form 'submit()' is getting called before the form is attached to the html document, is there a way I can wait until the form is attached to the dom? I used 'onLoad' function but still no luck. Any suggestion or answer is welcome. Thanks

    Comment

    Working...
    X