0

insert and replace attributes on yml:form don't always work

I'm counting on the insert and replace attributes on yml:form to do some simple ajax in our application. They were working fine until I needed to submit the form manually using a javascript function that got called when a radio button was clicked. When I add a submit button to the form, the insert and replace attributes work fine. If I remove the submit button and call form.submit() from the radio button's onclick function, the results show up in a new page. Would it be possible to make these attributes work even in the case when the form is submitted through javascript?

thanks

--Dan

by
2 Replies
  • Hey Dan - sorry running a little behind here. Unfortunately the problem here is that when the yml with ajax (insert / replace) functionality is rendered down, it renders to the base html / js / css. When you attempt to submit the way you are, you are just submitting the form without using that ajax functionality. Instead of doing this, why dont you build the ajax functionality yourself in the JS method you call onSubmit? You can capture the form fields, wrap them in a POST request and make the request quickly using the gadgets.io.makeRequest OpenSocial method.

    Jonathan LeBlanc
    Senior Software Engineer
    Yahoo! Developer Network
    Twitter: jcleblanc

    QUOTE (Dan W @ Apr 23 2009, 01:46 PM) <{POST_SNAPBACK}>
    I'm counting on the insert and replace attributes on yml:form to do some simple ajax in our application. They were working fine until I needed to submit the form manually using a javascript function that got called when a radio button was clicked. When I add a submit button to the form, the insert and replace attributes work fine. If I remove the submit button and call form.submit() from the radio button's onclick function, the results show up in a new page. Would it be possible to make these attributes work even in the case when the form is submitted through javascript?

    thanks

    --Dan
    0
  • Jon, thanks for the suggestion, but we have to use <yml:form> in this case, since links in gadgets.io.makeRequest responses don't work (see forum topic).
    0
  • Jon, if it's really the case that we can write a script that does the same thing as <yml:form>, then how do we go about getting links into the page that don't have target="_blank"?
    0
  • I've been working on trying to figure that one out. I ran several tests today and don't have a workaround yet. I'm trying to get you a workaround because the bug that I'm going to be filing for this won't be corrected within the time that you need (probably several months off I'm guessing). I'm going to keep working at this but I currently don't have a method for purging the target=_blank.

    Also, if you have any requests that are timely, you can e-mail me directly. If I'm out of town or wrapped up I may not be able to get to forum posts personally within a short time, but I usually get to all e-mails within a 24 hour period.

    - Jon

    QUOTE (Jared @ May 5 2009, 09:00 PM) <{POST_SNAPBACK}>
    Jon, if it's really the case that we can write a script that does the same thing as <yml:form>, then how do we go about getting links into the page that don't have target="_blank"?
    0

Recent Posts

in YAP