target_parent doesn't work in HTML widget

  • Profile Image
    SouthCoastCanvas
    Asked on April 09, 2014 at 02:03 AM

    Hi all,

    I have created a form to allow users of my website to navigate around, the idea being that they can select a canvas width from a dropdown, then depending on their choice a second dropdown is displayed allowing a canvas height to be selected. Based on their choices selected from these dropdowns a link button is then displayed allowing the user to click and navigate to their selected canvas size.

    My problem is, I have coded the link/button properties using the HTML widget and customised the appearance using CSS, I have then tried setting the target of each link to _parent. The widget is then saved and all is good, I can go to my website and these links within the form (which is embedded in an iframe) open in the same _parent window. However, if I go back to the form to edit, all of the _parent targets default back to _blank meaning that the links then open in a new tab when clicked on within the website.

    I would like the links to remain opening in the parent window and not default back to a new tab, ie: _blank, is there any way of doing this. Using the link editor in the WYSIWYG editor only offers _blank and _self, again _blank opens in a new tab and _self opens the webpage in the iframe which is no good as the iframe is only 200 x 230px.

    The form can be found in the green box on the right hand side of this page

    Is there anyway of coding this so that the links remain opening in the parent window.

    Many thanks in advance, Wayne

  • Profile Image
    abajan
    Answered on April 09, 2014 at 02:40 AM

    Hi Wayne,

    The best solution I can think of would be to insert the form's full source


    instead of just its iFrame into your page and edit the button codes there. That way the form builder won't be able to change target's value back to _blank.

    Would this be feasible in your case?

  • Profile Image
    SouthCoastCanvas
    Answered on April 09, 2014 at 09:14 AM

    Unfortunately not, the store itself is built using the Auctiva Commerce platform and they dont allow "form" tags within their HTML or Script widgets.

    I have thought about tackling it this way and uploading the forms code elsewhere as you have mentioned and then linking my stores iframe to the new location but am having dificulties finding a reliable host. I used to use pastehtml but they seemed to have periods of down time.

    Wayne

  • Profile Image
    TitusN
    Answered on April 09, 2014 at 10:32 AM

    Hello Wayne,

    Please try the following for each of your HTML buttons:

    Doing the steps above will remove the class designation for the HTML elements - you may want to add them back in. 

    Alternatively -

    But all those steps in the illustration are the same as changing the target to _self:

    I belive _self should be able to stick without being removed by our security screen - and it opens the link in the same window.

    Let us know if that helps.

  • Profile Image
    SouthCoastCanvas
    Answered on April 09, 2014 at 12:35 PM

    Unfortunately, already tried. The _self target opens the form in the iframe as opposed to the parent window. See below:

    iframe location

    (above) Location of iframe on webpage.

    (below) Link opens inside the iframe when target is set to _self.

    Form opening in iframe

    This method would be perfect if I could copy and paste the form code srtaight into my site but due to the platform not allowing <form> tags, this is not an option.

    I have also looked into adding script to the parent page that may override the target tag of the button links in the iframe and force any links to open in the parent window, but met a bit of a dead end.

  • Profile Image
    TitusN
    Answered on April 09, 2014 at 02:06 PM

    Hello,

    I have sent a ticket to our developers to enquire the possibility of implementing the target attribute in the HTML/Text field.

    We will update this threads upon any progress.

    In the meantime, please consider the following workaround:

    1. Take a PNG shot of your button, much like this:

    2. Upload it to your form using the image field:

    3. Then set the link, and the target attribute from the properties menu:

    Not ideal - but functional - http://form.jotformpro.com/form/40984984265975

  • Profile Image
    SouthCoastCanvas
    Answered on April 09, 2014 at 03:55 PM

    If it wasn't for the fact that I had already invested hours into creating the above form, adding all of the of the links and then finally going through and setting up all of the conditions I would have said....

    PERFECT!

    This works exactly how I need it to.

    Not sure how much time I should continue to invest in this, essentially it looks like a complete form rebuild, quite an extensive workaround. For the meantime I will leave the form as is, I have cloned the original which I shall make all of the changes to, eg, changing html widgets to images, setting up the links and then the laborious task of setting the conditions and once complete, make the change within the iframe instore.

    Thankyou very much for all of your assistance, I shall keep a look out to see if there is any developement on the implementation of _parent target attributed in the html widget and hopefully if it comes about sooner rather than later it may save me a shed load of work.

    Thanks again, Wayne

  • Profile Image
    SouthCoastCanvas
    Answered on April 09, 2014 at 08:12 PM

    Ok, so to summerise,

    A form can be created and links can be written into an HTML widget, using the WYSIWYG editor you have a choice of _blank or _self as target attibutes.

    Alternatively, you can write your own HTML and add the alternative target attributes _parent or _top. These can then be saved and the form saved, once saved the form can be used by the end user with the desired outcomes from the links.

    However as soon as you re-open the form for editing, all of the links that have had the target attributes _parent or _top manually added will revert back to a default _blank.

    For anyone having similar issues to me in that you want to retain a _parent attribute in your links you will need to create your finished form, then go through and edit any links within HTML widgets, save your form, and most importantly - don't open it up again for editing, as soon as you do the targets will default back. Alternatively, if you are creating link buttons or images, carry out the procedure as mentioned above - create a button image, place the button on the form using the image widget, then assign the properties via the properties link within the widget.

    As an additional note, form submissions can be viewed, forms can be disabled, cloned, renamed, other forms can be edited, etc from within 'My Forms' without altering the contents of the form, only opening it to edit will affect the target attributes.

  • Profile Image
    smartandstrong
    Answered on February 23, 2016 at 01:24 PM

    There's no way to do this exact thing but for text links? The only available option is for new window.
  • Profile Image
    Kevin_G
    Answered on February 23, 2016 at 03:51 PM

    @smartandstrong,

    Your question has been moved to this thread: http://www.jotform.com/answers/779432

    We will assist you there.

  • Profile Image
    miguelben
    Answered on March 22, 2016 at 03:49 PM

    The image option only seems to work on firefox. I tried it on Chrome and iExplorer and it opens a new tab.
  • Profile Image
    Kevin_G
    Answered on March 22, 2016 at 04:07 PM

    @miguelben

    I have moved your concern to this thread: https://www.jotform.com/answers/800424

    We will assist you as soon as possible.