View Full Version : Input Mask to generate html...
Christian1972
12-19-2003, 01:33 PM
Hi all,
i have made a simple input mask, can be seen at:
http://www.k3lshop.de/eingabemaske.html
It takes the 5 fields in to the source and shows the result below.
I now want to have a preview function.
Maybe a popup wich diplays the result of the generated source code, not only the code itself.
Hope somebody can help me...
Thanks a lot for any suggestions!!!
:santa: chrissi :santa:
Willy Duitt
12-19-2003, 01:49 PM
Try this:
<script type="text/javascript">
function HTML() {
f1=document.Formular;
f1.anzeige.focus();
val=f1.anzeige.value;
var Pop=window.open('','HTMLView');
with (Pop) {
document.write(val);
document.close();
}
}
</script>
</HEAD>
<BODY>
<input type="button" name="B1" value="Preview" onclick="HTML()">
.....Willy
Christian1972
12-19-2003, 03:18 PM
:)
Thanks a lot Willy!!!!!!!!!
That works well !!!!!!!!!!!!
Please tell me your comments on it now:
http://www.k3lshop.de/eingabemaske.html
Happy Christmas *gg*
Chrissi
Willy Duitt
12-19-2003, 03:31 PM
Your Welcome :D
I do not read or write deutsch;
But, code is code! :P
.....Willy
Edit: BTW: It was a good idea to add the english
translation to the buttons. And, thanks for the
courtesy of removing the no right click
script when you first posted.
Christian1972
12-19-2003, 04:44 PM
lol Willy
i am sure you are able to get the source even with this no right click script... its more than easy for every non-lamer :-)))
What about the way I've made the no-right-click
oncontextmenu="return false" onselectstart="return false"
Best and shortest option I now...
I did a bit for design, look again!!
THANKS FOR YOUR HELP !!!
Chrissi
Chrissi's Ebay Generator (http://www.k3lshop.de/eingabemaske.html)
Christian1972
12-19-2003, 04:50 PM
One more question Willy:
if i let one of the pic-fields empty,
than an image-link without URL will be generated.
I tryed to fix that but it did not work out...
any ideas for that?
onesmore: THANKS!
Chrissi
Willy Duitt
12-19-2003, 04:53 PM
Originally posted by Christian1972
I did a bit for design, look again!!
Chrissi's Ebay Generator (http://www.k3lshop.de/eingabemaske.html)
I prefer your first design.
Using IE6 and 1024 X 768
The entire page was horizontaly scrolled.
And yes, I have no less than 6 ways to disable
no right click scripts. But I for one, appreciate
you taking the time to remove it when asking for help. ;)
.....Willy
Willy Duitt
12-19-2003, 04:58 PM
Originally posted by Christian1972
One more question Willy:
if i let one of the pic-fields empty,
than an image-link without URL will be generated.
I tryed to fix that but it did not work out...
any ideas for that?
onesmore: THANKS!
Chrissi
You will need to to add a conditional statement
to check if the field(s) are empty or not.
I'm on my way out the door.
I will check it again later.
(if no one else has answered your question) :)
.....Willy
Christian1972
12-19-2003, 05:28 PM
hi Willy,
I just saw how many post you've written today, wow!
You are an upcoming...
:chainsaw:!!!-Monster-Poster-!!! :chainsaw: *gg*
Chrissi
Christian1972
12-19-2003, 10:51 PM
Dear Willy,
I got it fixed now with:
if(document.Formular.urlbild1.value !="") { schreibe +=' <img src="' + document.Formular.urlbild1.value + '" align="center">\r' };
Works well...
Chrissi
Willy Duitt
12-20-2003, 10:55 AM
Good Job! ;)
You could also check for the length.
if(document.Formular.urlbild1.value.length !=0)
Or, you could also check for the prescence of an extension.
if ((urlbild1.indexOf("gif") != -1) || (urlbild1.indexOf("jpg") != -1))
in the event the user is restricted to using certain types of images.
Sorry I did not have the time to look at it yesterday.
But am glad you were able to fix it yourself.
I hope my suggestion helped a little bit. :P
Kudos;
.....Willy
vBulletin® v3.6.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.