/    Sign up×
Community /Pin to ProfileBookmark

Getting form input to populate accordion content

I am trying to get it where the input from 2 form field populate the title and content of a jQery accordion, I want the user to be able to input the name of the video (which puts the title on the accordion tab…the h3 tags in this case) in one field and then put the Youtube URL in another form field which will be put automatically into the code of the accordion to put that video in the corresponding accordion body. The existing code for the accordion is below:

[code]
<script>
$(function() {
$( “#accordion” ).accordion();
});
</script>

<div class=”demo” style=”width:300″>

<div id=”accordion”>
<h3><a href=”#”>Interview with Tyrone</a></h3>
<div>
<iframe width=”420″ height=”315″ src=”http://www.youtube.com/embed/1UBGT9HkSQ4″ frameborder=”0″ allowfullscreen></iframe> </div>
<h3><a href=”#”>How to Make a Job Search Plan</a></h3>
<div>
<iframe width=”420″ height=”315″ src=”http://www.youtube.com/embed/8oRig0tE4UI” frameborder=”0″ allowfullscreen></iframe>
</div>
<h3><a href=”#”>Tough Interview Questions #1</a></h3>
<div>
<iframe width=”420″ height=”315″ src=”http://www.youtube.com/embed/7OEZSfdn6Jc” frameborder=”0″ allowfullscreen></iframe>
</div>

</div>

</div>

[/code]

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @frudedude spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...