submit inside a webblock

submit inside a webblock

  
I am trying to do a form submit with javascript inside a webblock  but when i do so the page is not displaying well like no css and the action of the event target doesnt trigger.

My code:


    theForm = document.WebForm1;

        theForm.__EVENTTARGET.value = <id of the submit button>;
        theForm.submit();

Hi FIlipe,

I'm not sure I understand your question. Could you elaborate on what it is you are trying to accomplish? Perhaps there is a better way to do it? Trying to submit a page directly from JavaScript is the very LAST thing on my bucket list :-)

Why can't you simply use the notifywidget action from within your web block to submit the form?

Cheers, 
Isaac
Hi,

Try 'clicking' (via javascript) a button. This button can be hidden with CSS.
"Why can't you simply use the notifywidget action from within your web block to submit the form?"

Because i dont want an extra widget on the page or a button to do the submit, the widget is what i am trying to do.
Filipe Lourenço wrote:
Because i dont want an extra widget on the page or a button to do the submit, the widget is what i am trying to do.
Well, that's your prerogative of course, but remember that the Platform is there to make your life easier, and does not necessarily produce the most efficient code or HTML. You're totallty free to handcode every detail, and bypass the platform's Ajax etc., but in that case you're probably better off without the platform in the first place.