Re: [Moo] Copying the HTML document

2012-03-19 Thread Matthew Hazlett
Thanks! Sanford Whiteman wrote: You're outdoing yourself with this, dude! Thanks for the contribution. -- S.

Re: [Moo] Copying the HTML document

2012-03-19 Thread Matthew Hazlett
That won't preserve any of the form values, but if all you are concerned about is the HTML then that would work. However, the script I wrote will preserves all the form values and will optionally let you turn the form elements to readonly or disabled so they can't be changed.. Steve Onnis

RE: [Moo] Copying the HTML document

2012-03-19 Thread Steve Onnis
ools-users@googlegroups.com Subject: Re: [Moo] Copying the HTML document I added a getTagfunction. Also fixed an error in webkit browsers for dropdown lists function getTag(name){ var dump = $(document.html).outerHTML, regex = new RegExp('<'+name+'[^>]*>','im'), matc

Re: [Moo] Copying the HTML document

2012-03-19 Thread Sanford Whiteman
You're outdoing yourself with this, dude! Thanks for the contribution. -- S.

Re: [Moo] Copying the HTML document

2012-03-18 Thread Matthew Hazlett
I added a getTagfunction. Also fixed an error in webkit browsers for dropdown lists function getTag(name){ var dump = $(document.html).outerHTML, regex = new RegExp('<'+name+'[^>]*>','im'), match = regex.exec(dump); return match[0]; } as you can see getTag uses the outerHTML property and grabs

RE: [Moo] Copying the HTML document

2012-03-18 Thread Steve Onnis
ch 2012 11:06 AM To: mootools-users@googlegroups.com Subject: Re: [Moo] Copying the HTML document I decided to change the way it was rendering, its better now, got rid of a few issues: http://jsfiddle.net/hazlema/BwczU/ Supports: * text input * radio input * checkbox input

Re: [Moo] Copying the HTML document

2012-03-17 Thread Matthew Hazlett
One last note: The script works in IE, however IE has issues updating the iFrame (and I haven't tried to fix it because in the real world you wouldn't be using it to output to an iFrame anyway). So use Firefox or whatever browser that's not IE to view the demo :-)

Re: [Moo] Copying the HTML document

2012-03-17 Thread Matthew Hazlett
I decided to change the way it was rendering, its better now, got rid of a few issues: http://jsfiddle.net/hazlema/BwczU/ Supports: * text input * radio input * checkbox input * button input * select (dropdowns) * textarea It's as easy to add to your project as calling the render functio

Re: [Moo] Copying the HTML document

2012-03-16 Thread Matthew Hazlett
I can't help myself, I love making things: http://jsfiddle.net/pcKrg/6/ Just cleaned it up a bit so its easier to read.

Re: [Moo] Copying the HTML document

2012-03-16 Thread Matthew Hazlett
Did one more update for you http://jsfiddle.net/pcKrg/5/ I added the name support I mentioned so you can have multiple sets of radio buttons.

Re: [Moo] Copying the HTML document

2012-03-16 Thread Matthew Hazlett
With radio button support: http://jsfiddle.net/pcKrg/4/ It's up to you to add checkboxes and refine the radiobutton slik query to clear only the proper "named" butttons

Re: [Moo] Copying the HTML document

2012-03-16 Thread Matthew Hazlett
Heh, I don't want to do all the work. It's possible, you add new 'change' events for input[type=radio] and write something like: // reset all the radio buttons to off (you can add a name from // e.target.get('name') but i'll leave that up to you // $$('input[type=radio]).set('defaultCheckbox',

RE: [Moo] Copying the HTML document

2012-03-16 Thread Steve Onnis
the HTML document Made another example for you so you could see how it works: http://jsfiddle.net/pcKrg/3/ Move the box around and hit DUMP, it will send the contents to an iframe. Populate the form etc... Hope this helps...

Re: [Moo] Copying the HTML document

2012-03-16 Thread Matthew Hazlett
Made another example for you so you could see how it works: http://jsfiddle.net/pcKrg/3/ Move the box around and hit DUMP, it will send the contents to an iframe. Populate the form etc... Hope this helps...

Re: [Moo] Copying the HTML document

2012-03-16 Thread Matthew Hazlett
When you dump the html file, it will have all the current layouts. if Div1 was moved and made visable by a script it will show Div1 as moved and visible, its basically taking a snapshot of the html page as it is at that moment in time. Scripts/header tags and all. Only thing you will have to

RE: [Moo] Copying the HTML document

2012-03-16 Thread Steve Onnis
...@gmail.com] Sent: Friday, 16 March 2012 7:29 PM To: mootools-users@googlegroups.com Subject: Re: [Moo] Copying the HTML document Can't save to a flat file with js alone, you would need to post it to an aspx or php page. but you could do something like this to capture the html page with the v

Re: [Moo] Copying the HTML document

2012-03-16 Thread Matthew Hazlett
Can't save to a flat file with js alone, you would need to post it to an aspx or php page. but you could do something like this to capture the html page with the values: http://jsfiddle.net/pcKrg/ Barry van Oudtshoorn Friday, March 16, 2012 4:16 AM Perhaps

RE: [Moo] Copying the HTML document

2012-03-16 Thread Steve Onnis
...@gmail.com] Sent: Friday, 16 March 2012 7:17 PM To: mootools-users@googlegroups.com Subject: Re: [Moo] Copying the HTML document Perhaps something as simple as using data- fields, like in this (very quickly thrown together and by no means ready for use) example: http://jsfiddle.net/barryvan/XKbVp

Re: [Moo] Copying the HTML document

2012-03-16 Thread Barry van Oudtshoorn
Perhaps something as simple as using data- fields, like in this (very quickly thrown together and by no means ready for use) example: http://jsfiddle.net/barryvan/XKbVp/ You can then read off the values from data-value in each of the inputs. On 16/03/12 16:02, Steve Onnis wrote: I have a web

[Moo] Copying the HTML document

2012-03-16 Thread Steve Onnis
I have a web form and I am trying to find out a way that i can copy the contents of a HTML page with all data in the form so i can save it to a file. Can anyone suggest a way that i might be able to do this? I have been doing this new Element("div").adopt($(document.body).getParent("html