Current location: Hot Scripts Forums » General Web Coding » JavaScript » Remove input value


Remove input value

Reply
  #1 (permalink)  
Old 03-16-10, 07:09 AM
RichyRich38's Avatar
RichyRich38 RichyRich38 is offline
Newbie Coder
 
Join Date: Feb 2009
Posts: 78
Thanks: 2
Thanked 0 Times in 0 Posts
Remove input value

Hi Guys I would like some help and advice on how to remove the value from an input field

Here is the problem:

Shopping Basket - default site title

As you can see the inputs all have a value that is being displayed.

I would like to remove these values.. I dont have access to the code that pulls them in.

so Im thinking the best way would be to remove them with javascript once the page had loaded..

Is this possible?? as I would have no idea where to start

any help would be very much appricated
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 03-16-10, 07:19 AM
wirehopper's Avatar
wirehopper wirehopper is offline
-
 
Join Date: Feb 2006
Posts: 2,516
Thanks: 20
Thanked 109 Times in 106 Posts
I'd read the documentation for the cart first - you may be able to disable the preset values.

If not, you can use view source and javascript to clear the values with code like this:

<script type="text/javascript">
document.getElementById('inputname').value='';
</script>

in the template or skin HTML.

Not tested.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 03-16-10, 07:30 AM
RichyRich38's Avatar
RichyRich38 RichyRich38 is offline
Newbie Coder
 
Join Date: Feb 2009
Posts: 78
Thanks: 2
Thanked 0 Times in 0 Posts
Hi Thank you for getting back,

Yeah i did ask them and there reply was
" As there are other sites running on the current basket and checkout, there are 2 options:
1. Use javascript to remove the value of those fields"
2. Pay them to make a new custom template (which i might have to do)"

Ill try you method, but will this be able to work as the two input in question are
<input type="submit" value="update"/> and <input type="submit" value="checkout" name="checkout"/> neither of which have an ID
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 03-18-10, 12:50 PM
CodeRobber's Avatar
CodeRobber CodeRobber is offline
Newbie Coder
 
Join Date: Feb 2010
Location: Leicestershire UK
Posts: 19
Thanks: 0
Thanked 2 Times in 2 Posts
I dont know if this will help but you can use the javascript

getElementsByName();

However your input type="submit" does not have a name...

It might be easier to break into the code of the site and change it there rather than trying to do it via javascript on the frontend.
__________________
Web Design - SEO - Ecommerce Website Design
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
input onclick blinn_shade JavaScript 1 02-04-08 08:02 AM
Add / Remove form elements, that post array m_abdelfattah JavaScript 7 06-24-07 10:11 PM
Multiple input box from combo-box qie JavaScript 7 05-04-07 08:39 AM
PHP - Unable to remove items from a file AdrianLewis PHP 5 03-17-06 06:14 AM
How come Account_Type and Organization cannot accept user input? toezaurus81 C/C++ 1 07-30-04 02:59 PM


All times are GMT -5. The time now is 06:38 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.