Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Pre filled search text box

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #11  
Old 03-06-2008, 09:56 AM
  boomobile's Avatar 
boomobile boomobile is offline
 

eXpert
  
Join Date: Oct 2007
Posts: 306
 

Default Re: Pre filled search text box

Can you do this for "product options" selection box as well? Some of our customers don't realize that if they don't choose an option, then x-cart will use the first option. I want the box to read, "Please make a slection" and not be able to process until they do.

Does anyone know the code and where to place them?
__________________
X Cart Ver: 4.0.14
MySQL4 4.1.22
phpMyAdmin 2.6.0
Pearl 5.6.0
PHP 5.2.1
Python 2.2.2
Server: Apache/2.0.52 (Red Hat)
OS: Linux
www.cleanlinesurf.com
1. Customer Rewards Points
2. One Page Checkout (altercart)
3. Free shipping orders over $50 as Real Time Shipping
4. Gift Certificates
-----------------------------------------------
Graphic Design | Boomobile Design, LLC
www.boomobile.com
Reply With Quote
  #12  
Old 03-06-2008, 10:15 AM
  kube's Avatar 
kube kube is offline
 

X-Adept
  
Join Date: Sep 2005
Location: London: a small place East of Wales
Posts: 529
 

Default Re: Pre filled search text box

That may, I would have thought, require a little more involvement including a few templates to edit and digging through the relevant javascript file that it talks to.

1. You would need to create in .tpl a default OPTION, say "Please choose".
2. With the js if the OPTION still remains as "Please choose" prompt with an alert.

There's probably more to it than that. But i haven't got 4.0 code on me
__________________
Doms
kube v4.1.9
Reply With Quote
  #13  
Old 03-06-2008, 10:35 AM
 
bobb bobb is offline
 

Member
  
Join Date: Jul 2005
Location: LI, NY, USA
Posts: 27
 

Default Re: Pre filled search text box

No need for code. Make the first option ( # zero) a heading like CHOOSE XYZ.. Then don't allow it pass validation.
Code:
if (product_option('RATIO_+_UNIT').selectedIndex == 0) { alert('You must select a ratio and carrier!'); return false; } else { return true; }
Well that is code, but it gets input as data!
__________________
X-Cart Gold v 4.0.18
FreeBSD 6.2, Apache 2.2.11, PERL 5.8.8, PHP 5.2.10, MySQL 5.0.84
rearendparts.com
Reply With Quote
  #14  
Old 03-06-2008, 06:40 PM
 
carpeperdiem carpeperdiem is offline
 

X-Guru
  
Join Date: Jul 2006
Location: New York City, USA
Posts: 5,399
 

Default Re: Pre filled search text box

Here's another way to do this:

http://forum.x-cart.com/showthread.php?p=189859#post189859
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4
Reply With Quote
  #15  
Old 03-10-2008, 07:10 AM
  carlisleglass's Avatar 
carlisleglass carlisleglass is offline
 

eXpert
  
Join Date: Aug 2003
Location: Carlisle, UK
Posts: 316
 

Default Re: Pre filled search text box

Improved it a little bit - say you have enter a search term, click away from the box by accident and click back on it, it will clear the contents. This coding will check to see if anything apart from the default text is in the box, and if the default text is not in the box, will not clear it.

value="{$lng.lbl_my_text}" onFocus="if(this.value=='{$lng.lbl_my_text}') this.value='';" onBlur="if(this.value=='') this.value='{$lng.lbl_my_text}';" />
__________________
Darren Kierman
Carlisle Glass (http://www.carlisleglass.co.uk/)
... running X-Cart Gold 4.4.5 [unix]
Reply With Quote
  #16  
Old 03-10-2008, 07:15 AM
  kube's Avatar 
kube kube is offline
 

X-Adept
  
Join Date: Sep 2005
Location: London: a small place East of Wales
Posts: 529
 

Default Re: Pre filled search text box

Thanks carlisle works great,

I was going to post something not to dissimilar to that - but I was worried about filling your page with excess code.
__________________
Doms
kube v4.1.9
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 03:51 PM.

   

 
X-Cart forums © 2001-2020