lting
06-06-2004, 09:29 PM
i have fews submit buttons on my page ... but i wish to change the button to a .gif or a TEXT TYPE rather than the button look ... may i know how?
|
Click to See Complete Forum and Search --> : change submit button to a pic or a text? lting 06-06-2004, 09:29 PM i have fews submit buttons on my page ... but i wish to change the button to a .gif or a TEXT TYPE rather than the button look ... may i know how? fredmv 06-06-2004, 09:39 PM Image:<input type="image" src="submit.png" value="Submit" />Text:<a href="document.forms[0].submit();">Submit</a> <noscript><input type="submit" value="Submit" /></noscript> lting 06-06-2004, 10:59 PM if i use the <a href="document.forms[0].submit();">Submit</a> <noscript><input type="submit" value="Submit" /></noscript> how to write the CSS to make the "Submit" in white color ... and no underline. besides when user click on it .. the color still remain the same as white color .. don't want it behave like normal link... and if i use text link as submit .. how i apply the onclick trigger? cos normally i can do <input type="submit" value="Submit" onclick="call()" > ... so now how am i going to apply the trigger on the text type submit format? thanks :):) :D lting 06-06-2004, 11:15 PM <form enctype="multipart/form-data" name = "frmCompany" method="POST" action="<?php echo $_SERVER['PHP_SELF']; ?>" > this is my form name ... and the link is <td width="90" class="btnborder"><div align="center"><a href="document.frmCompany.submit();">Submit</a> <noscript><input type="submit" value="Submit" /></noscript></div></td> but it doens't work? it bring me to a page with URL "htdocs\smarthrv2\company\document.frmCompany.submit();" David Harrison 06-06-2004, 11:16 PM Have this as your CSS:#submitlink, #submitlink:link, #submitlink:visited, #submitlink:focus, #submitlink:hover{ color:#fff; text-decoration:none; } #submitlink:active{ color:#fff; text-decoration:underline; }And then use this code for the link:<script type="text/javascript"><!-- document.write('<a href="#" id="submitlink" onclick="call();">Submit</a>'); //--></script> <noscript><input type="submit" value="Submit" /></noscript>I used document.write for the link because otherwise it would be confusing for someone with JavaScript disabled to find a link that does nothing and a submit button that works. Sorry Fred but you weren't online and I was bored and needed something to do. :p Edit: I think that Fred meant to put that JavaScript code inside the onclick attribute. fredmv 06-06-2004, 11:20 PM Originally posted by lavalamp Sorry Fred but you weren't online and I was bored and needed something to do.No problem by any means! Anyone's free to participate in any thread they want. Plus you're the moderator for this section. ;)Originally posted by lavalamp Edit: I think that Fred meant to put that JavaScript code inside the onclick attribute. Good catch. I sure screwed that one up… David Harrison 06-06-2004, 11:29 PM Originally posted by fredmv Anyone's free to participate in any thread they want.Forums are a bit impersonal so I just wanted to be sure that I wasn't going to offend you by stepping in. Originally posted by fredmv you're the moderator for this section.It's great to be a moderator. :D I've not actually had to do much yet (everyone here is so nice!) but it's the feeling that I've earned a position of trust and responsibility. lting 06-07-2004, 01:07 AM i still can't get the this correct ... <?php if(isset($_POST['txtCompanyName'])) { $com = $_POST['txtCompanyName']; }else{ $com = ""; } ?> <form enctype="multipart/form-data" name = "frmCompany" method="POST" action="<?php echo $_SERVER['PHP_SELF']; ?>" > <input name="txtCompanyName" type="text" class="textFieldText" size="50" maxlength="100" value="<?php echo $com; ?>"> <td width="90" class="btnborder"><div align="center"> <script type="text/javascript"><!-- document.write('<a href="#" id="submitlink" onclick="call();">Submit</a>'); //--></script> <noscript><input type="submit" value="Submit" /></noscript> </div></td> help ... when i click the Submit ... it only goes to the top of the page! what i want to do is submit the value inside my form! lting 06-07-2004, 01:29 AM thanks i get it down! hehe forgot that i have to write a javascript function function call() { document.frmCompany.submit(); } David Harrison 06-07-2004, 09:38 AM Originally posted by lting <input type="submit" value="Submit" onclick="call()">Lol, I assumed that you would already have that function. Vladdy 06-07-2004, 09:45 AM How about separating functionality from presentation: www.vladdy.net/Demos/submitimage.html David Harrison 06-07-2004, 09:55 AM That styles a submit button to be an image, the OP here wanted a text link. On reflection though, I suppose it might be possible to style the button in such a way as to get that effect. Vladdy 06-07-2004, 10:07 AM If you insist: :D:D www.vladdy.net/Demos/SubmitStyling.html David Harrison 06-07-2004, 10:13 AM Mildly impressive I suppose. :D I'm just wondering, why isn't your markup invalid? You have inputs but not in a form. webdeveloper.com
Copyright Internet.com Inc., All Rights Reserved. |