Bug #23053 Bug Fixed

liveUrlTitle() works only on the first form on a page. If two or more forms, it doesn’t work on the others.

Version: 3.5.5 Reporter: SChristy

This is an archived bug report. If you are experiencing a similar issue, upgrade to the latest release and if that does not solve the problem, submit a new bug report

To re-create, set up a simple template with two forms on it, both using the

onkeyup="liveUrlTitle();"

function. Only the first form will work. On the second, the liveUrlTitle() function will use the data from the first form but not put it anywhere. This is because the liveUrlTitle() function is set up at the document level instead of at the form level. The expected outcome is that both would work.

Here is my sample code:

<div class="well">
      {exp:channel:form channel="homepage_videos" include_jquery="no" return="/"}
     <div>
      <label for="title">Title:</label>
      <input name="title" type="text" id="title" maxlength="100" >
      <input type="hidden" name="url_title" id="url_title" value="{url_title}" maxlength="75" size="50">
       
      <label for="video_file">Embed code for chosen video:</label>
      {field:video_embed}
      <button type="submit" name="submit" class="btn btn-primary btn-success">Submit</button>
     </div>
      {/exp:channel:form}
    </div>

    <div class="well">
      {exp:channel:form channel="homepage" include_jquery="no" return="/"}
     <div>
      <label for="title">Title:</label>
      <input name="title" type="text" id="title" maxlength="100" >
      <input type="hidden" name="url_title" id="url_title" value="{url_title}" maxlength="75" size="50">
       
      {field:body_field}
      <label for="news_image">Image for post header:</label>
      {field:news_image}
                        <button type="submit" name="submit" class="btn btn-primary btn-success">Submit</button>
     </div>
      {/exp:channel:form}
    </div>

My current work-around is to set up my own JS code to handle the second form instance. However, it would be better if the liveUrlTitle() function was connected to the form, not the document.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases