Fenhopi Posted December 15, 2010 Share Posted December 15, 2010 Hi! First of, I want to say that I don't have a lot of knowledge with js, so please bare with me. I have this function: function formFunction() { return new LightFace({ title: $('demo1title').value, content: $('demo1content').value, draggable: true }).open(); } It is a part of a code that displays a small on-page window. However, within that code I want to have a form that posts $('demo1title').value as a hidden value. Any idea how to do this? Quote Link to comment Share on other sites More sharing options...
Adam Posted December 15, 2010 Share Posted December 15, 2010 From what I can tell looking at the documentation (this is it right?), the content proper just contains the HTML you want to show. Pass the form's HTML to that and you should be able to create the form? Unless I'm misunderstanding what it is you're trying to do? Quote Link to comment Share on other sites More sharing options...
Fenhopi Posted December 15, 2010 Author Share Posted December 15, 2010 Ah, I tried this, but it doesn't work: function termsFunction() { box = new LightFace({ title: 'Terms and conditions', width: 400, height: 300, content: " <form method="post" id="start" action="postback.php"> <input type="hidden" name="postbackto" value="<? echo $friendshares['byuser']; ?>"> <input type="hidden" name="postbackfrom" value="<? echo $friendshares['person']; ?>"> <INPUT NAME="post" TYPE="submit" class="submit" value="That's nice" ALT="like"> </form>", buttons: [ { title: 'I Agree', event: function() { box.fade(0.5); var confirm = new LightFace({ width: 200, title: 'Confirm', keys: { esc: function() { this.close(); box.unfade(); } }, content: 'Do you agree?', buttons: [ { title: 'Yes', event: function() { this.close(); box.close(); }, color: 'green' }, { title: 'No', event: function() { this.close(); box.unfade(); } } ] }); confirm.open(); }, color: 'blue' }, { title: 'Close', event: function() { this.close(); } } ] }); box.open(); } Any ideas? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.