Click here to Skip to main content
15,792,771 members
Home / Discussions / JavaScript
   

JavaScript

 
Questionhigher order functions Pin
atomattacker-png21-Dec-20 2:49
atomattacker-png21-Dec-20 2:49 
AnswerRe: higher order functions Pin
Richard MacCutchan21-Dec-20 3:06
mveRichard MacCutchan21-Dec-20 3:06 
GeneralRe: higher order functions Pin
atomattacker-png21-Dec-20 3:21
atomattacker-png21-Dec-20 3:21 
GeneralRe: higher order functions Pin
Richard MacCutchan21-Dec-20 4:13
mveRichard MacCutchan21-Dec-20 4:13 
GeneralRe: higher order functions Pin
Richard MacCutchan21-Dec-20 5:02
mveRichard MacCutchan21-Dec-20 5:02 
GeneralRe: higher order functions Pin
atomattacker-png21-Dec-20 5:36
atomattacker-png21-Dec-20 5:36 
GeneralRe: higher order functions Pin
Richard MacCutchan21-Dec-20 5:44
mveRichard MacCutchan21-Dec-20 5:44 
QuestionAttempting to pre-populate text field and mailto based on ID Pin
Member 1502531419-Dec-20 2:10
Member 1502531419-Dec-20 2:10 
Hi, i have created a favourite button which once clicked uses .append to add onto the favourites page the option clicked. I am having difficulties grabbing all the results on that page and displaying it in a textfield which can then be emailed. Below is what i got so far many thanks.

<!-- This is page 1-->
    <div data-role="page" id="item1">


<!-- favourites button-->
          <fieldset data-role="controlgroup" data-type="horizontal">
              <input type="checkbox" name="favourite1" id="favourite1" class="custom">
              <label for="favourite1">Add to favourites</label>
			  <div id="dog"><img id="theImg"  src="images/dog.png" />Where is the image?</div>
           </fieldset>


<!-- This is page 2-->
    <div data-role="page" id="item2">
     
      <div data-role="header" data-position="fixed"> <!-- header-->
        <h1>Item 2</h1>
      </div>


<!-- favourites button-->
         <fieldset data-role="controlgroup" data-type="horizontal">
             <input type="checkbox" name="favourite2" id="favourite2" class="custom">
             <label for="favourite2">Add to favourites</label>
          </fieldset>


<!-- Favourites page -->
   <div data-role="page" id="favourites">

     <div data-role="header" data-position="fixed"> <!-- header-->
       <h1>Favourites</h1>
     </div>

     <div role="main" class="ui-content"> <!-- main contain-->

      <h1>Favourites</h1>

       <!-- buttons allowing navigation to item 1 and item 2-->
         <a href="#item1" class="ui-btn ui-btn-inline">Item 1 page</a>
         <a href="#item2" class="ui-btn ui-btn-inline">Item 2 page</a>

         <div id="favourite-content"><p>My favourites: </p></div>

       <div id="list"
       <form action="mailto:@mail.com Feedback" method="post" enctype="text/plain">
           Email Adress:<br />
       <input type="text" id ="fav" name="email_address" value="" maxlength="100" /><br />

       <input type="submit" value="Submit" />

       </form>
       </div>



$(document).on( 'pagecontainerbeforehide', 'body', function( event, ui){
//do something
if ( ui.nextPage.attr('id')== "favourites") {
$("#favourite-content").html ("");
if ($( "#favourite1" ).is( ":checked" )) {
$("#favourite-content").prepend('<img id="theImg" src="images/dog.png"/>');
}
if ($( "#favourite2" ).is( ":checked" )) {
$("#favourite-content").append("<p>item2 details</p>");
}

}

});


QuestionLooking to run a PHP page in the background using pure Javascript Pin
jkirkerx17-Dec-20 14:50
professionaljkirkerx17-Dec-20 14:50 
AnswerRe: Looking to run a PHP page in the background using pure Javascript Pin
DerekT-P17-Dec-20 23:54
professionalDerekT-P17-Dec-20 23:54 
GeneralRe: Looking to run a PHP page in the background using pure Javascript Pin
jkirkerx18-Dec-20 7:10
professionaljkirkerx18-Dec-20 7:10 
GeneralRe: Looking to run a PHP page in the background using pure Javascript Pin
DerekT-P18-Dec-20 8:11
professionalDerekT-P18-Dec-20 8:11 
GeneralRe: Looking to run a PHP page in the background using pure Javascript Pin
jkirkerx18-Dec-20 8:53
professionaljkirkerx18-Dec-20 8:53 
GeneralRe: Looking to run a PHP page in the background using pure Javascript Pin
DerekT-P18-Dec-20 9:26
professionalDerekT-P18-Dec-20 9:26 
GeneralRe: Looking to run a PHP page in the background using pure Javascript Pin
jkirkerx18-Dec-20 9:47
professionaljkirkerx18-Dec-20 9:47 
AnswerRe: Looking to run a PHP page in the background using pure Javascript Pin
jkirkerx18-Dec-20 13:27
professionaljkirkerx18-Dec-20 13:27 
AnswerRe: Looking to run a PHP page in the background using pure Javascript Pin
jkirkerx18-Dec-20 14:31
professionaljkirkerx18-Dec-20 14:31 
AnswerGot it Pin
jkirkerx18-Dec-20 14:47
professionaljkirkerx18-Dec-20 14:47 
QuestionFinding the definition of a component from the place of its use Pin
simpledeveloper18-Dec-20 20:43
simpledeveloper18-Dec-20 20:43 
QuestionRe: Finding the definition of a component from the place of its use Pin
Richard MacCutchan18-Dec-20 0:39
mveRichard MacCutchan18-Dec-20 0:39 
AnswerRe: Finding the definition of a component from the place of its use Pin
simpledeveloper18-Dec-20 16:40
simpledeveloper18-Dec-20 16:40 
GeneralRe: Finding the definition of a component from the place of its use Pin
Richard MacCutchan18-Dec-20 23:40
mveRichard MacCutchan18-Dec-20 23:40 
Questiondatepicker on button click not working Pin
Dhyanga17-Dec-20 4:45
Dhyanga17-Dec-20 4:45 
QuestionTernary operator Pin
atomattacker-png12-Dec-20 6:06
atomattacker-png12-Dec-20 6:06 
AnswerRe: Ternary operator Pin
Sandeep Mewara12-Dec-20 6:42
mveSandeep Mewara12-Dec-20 6:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.