| | |
How do I generate html script by using a form?
Please support our HTML and CSS advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jun 2009
Posts: 3
Reputation:
Solved Threads: 0
I have a template for my ebay auctions. I want to make a form that I can type in the variable information (ie title, description, images) and generate the html script to include those variables.
Question ripped from here
http://answers.yahoo.com/question/in...2152917AAED8nE
Just so you can spam your sig-links.
http://answers.yahoo.com/question/in...2152917AAED8nE
Just so you can spam your sig-links.
If you want to keep away from PHP and the rest of the server-side languages you can use some simple javascript with regular expressions, or even embedding the variables.
Javascript Example -
PHP Example -
html for form
Hope that helps!
Javascript Example -
html Syntax (Toggle Plain Text)
<form onsubmit="pop()" action="#" id="inForm"> <input id="color" type="text" /></form> <textarea readonly="readonly" id="out"></textarea>
JavaScript Syntax (Toggle Plain Text)
var color = document.getElementById('color'); var text = '<span style="color:'+color+';">Colored Text</span>'; document.getElementById('out').innerHTML = text; document.getElementById('inForm').style.display = 'none';
PHP Example -
php Syntax (Toggle Plain Text)
<?php function get($var){ //Validation and filtering $varI = $_GET[$var]; if ($varI.len() > 200){ } else { echo(strip_tags($varI)); } } ?> <div style="color:<?php get('color'); ?>"><?php get('name'); ?></div>
html for form
html Syntax (Toggle Plain Text)
<form action="generate.php"><input name="color" type="text" /><br /><input name="name" type="text" /></form>
Hope that helps!
Last edited by peter_budo; Jul 8th, 2009 at 6:51 am. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
CodeJoust! Design + Development - Proud User of Ubuntu
![]() |
Similar Threads
- how to generate html files using javadocs? (Java)
- generate sql script (ASP.NET)
- Please help. HTML:Script.inf and WinRPoly[Cryp] found (Viruses, Spyware and other Nasties)
- Generate to html (JSP)
- function in php (PHP)
- html/php form for .htaccess validation (PHP)
- [urgent] HTML form => XML file (JSP)
Other Threads in the HTML and CSS Forum
- Previous Thread: BluHost... Good Start?
- Next Thread: need help to my css dropdown menu
| Thread Tools | Search this Thread |
appointments asp background backgroundcolor beta browser bug calendar cart cgi code codeinjection corporateidentity css design development displayimageinsteadofflash dreamweaver emailmarketing epilepsy explorer firefox flash form format google griefers hackers hitcounter hover html ide ie7 ie8 iframe image images internet internetexplorer intranet iphone javascript jpeg layout macbook maps marketshare microsoft mozilla multimedia navigationbars news offshoreoutsourcingcompany opacity opera optimization pnginie6 positioning problem scroll seo shopping studio swf swf. textcolor timecolor titletags url urlseparatedwords visual visualization web webdevelopment webform website windows7






