Changing buttons to images

Discussion in 'HTML & Website Design' started by red_fiesta, Nov 22, 2006.

  1. #1
    if one wants to change a submit button to an image one can change

    <input type="submit" value="go" />

    to

    <input type="image" src="next2.jpg" />

    but what happens when one wants to change a normal button that doesnt submit the for..

    ie

    <input type="button" id="image2" value="Add" >


    what would this change to ....

    i know this is wrong..

    <input type="image" src="browse.jpg" id="image2" />

    as it submits the form..

    please help

    thanks
     
    red_fiesta, Nov 22, 2006 IP
  2. crazybjörn

    crazybjörn Peon

    Messages:
    270
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Add an onclick javascript event?
     
    crazybjörn, Nov 22, 2006 IP
  3. red_fiesta

    red_fiesta Peon

    Messages:
    125
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    well

    this is the code it already executes..

    <script type="text/javascript">
    			function showimg(){
    				
    				var f=function(){
    					window.SetUrl=function(value){
    						document.getElementById('image').value=value;
    					}
    					var filemanager='/browser/default/browser.html';
    					var connector='/default/connectors/asp/connector.asp';
    				    window.open(filemanager+'?Connector='+connector+'&Type=Image','fileupload','modal,width=600,height=400');
    				}
    				document.getElementById('image2').onclick=f;
    				
    			}
    		</script>
    		
    
    <body onLoad="showimg()">
    
    
    
     <input type="button" id="image2" value="Add Image" src="adminImages/browse.jpg" />
    	
    		
    		
    		
    	   <input type="text" id="image" name="image" size="50" readonly="true">
    
    Code (markup):
    so u wabt to change the button to an image....

    any ideas..
     
    red_fiesta, Nov 22, 2006 IP