473,394 Members | 1,701 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Changing an initial value using javascript

Hi All,

I'm wondering how I would change an initial value to a blank value if nothing gets entered into the text field. I have a form with multiple fields that visitors can enter data in to get the search results they want. For example right now I have this,

Expand|Select|Wrap|Line Numbers
  1. <input  id="IDX-text_landArea" name="kw_landArea" maxlength="255" type="text" onfocus="if (value == 'Lot Size') {value =''}" onsubmit="if (value == 'Lot Size') {value = ''}" value="Lot Size"/>
  2.  
If that stays as is when someone hits the submit button without changing that specific text field than I don't get the results I want because it passes the "Lot Size" value to the search form.

What I want to know is how I could create a function or something like that that would change the value from "Lot Size" to a blank value. Any and all help is appreciated. Thanks!!!
Aug 27 '09 #1
1 2506
gits
5,390 Expert Mod 4TB
the onsubmit is useless at this point since it just works at the form-node. and you use value without declaring or retrieving it from the node ... so basicly it should work when you use this.value instead ... which refers to the node's value property ...
Aug 28 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: M Wells | last post by:
Hi All, Just wondering how you go about changing the value of a session cookie via javascript? I have a PHP page that sets a session cookie when it first loads. I'd like to be able to change...
2
by: dsnyder | last post by:
This HTML has a bit of Javascript at the end that puts the initial focus on the userID field. It works great on Windows2000 running IE6, but the initial focus never goes to the userID field on...
31
by: Arthur Shapiro | last post by:
I'm the webmaster for a recreational organization. As part of one page of the site, I have an HTML "Calendar at a Glance" of the organization's events for the month. It's a simple table of a...
5
by: Good Man | last post by:
Hi there I'm adding form fields on the fly with some javascript DOM programming. I basically just clone a hidden <div>, then adjust node properties to make this new <div> have unique values...
1
by: Paul M. Frazier, Ph.D. | last post by:
I am writing a user information update page and I populate the form on Page_Load with the current values of the user's name, etc. When I change the text in one of the textbox controls (e.g.,...
4
by: David Coffin | last post by:
I'd like to subclass int to support list access, treating the integer as if it were a list of bits. Assigning bits to particular indices involves changing the value of the integer itself, but...
3
by: john.dickeson | last post by:
Hello I have been wrestling with a problem, I am trying to change the url of an Iframe from a simple selection box, once the user selects the desired url they wish to visit from the main page the...
4
by: Robert Bravery | last post by:
HI all, In JS, how can I change the selected value of a dropdownlist(select options) I know the value of indexed value of the selected value before it is changed. Thanks Robert
1
by: rag84dec | last post by:
Hi, I have an asp code which creates a grid or matrics (5 x 5 matrics).Each cell contains a button which will have an initial .The initial will be read from a database. say the database has...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.