473,799 Members | 2,772 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Which is correct?

In my java script to set the value I am using the following code

document.frmMyF orm.txtCustNo.v alue = "xxxxx"

&

document.frmMyF orm.txtCustNo.v alue = 'xxxxx'

Questions is single quote or double quote is right way coding?

Thanks,

Nelson
Nov 18 '05 #1
7 1271
well either is fine though i prefer single quote to explicity distinguish
between server side string and client side.

--

Regards,

Hermit Dave
(http://hdave.blogspot.com)
"Nelson Smith" <Ne*****@hotmai l.com> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
In my java script to set the value I am using the following code

document.frmMyF orm.txtCustNo.v alue = "xxxxx"

&

document.frmMyF orm.txtCustNo.v alue = 'xxxxx'

Questions is single quote or double quote is right way coding?

Thanks,

Nelson

Nov 18 '05 #2
What is the professional way of doing it?
Thanks,
Nelson

"Hermit Dave" <he************ @CAPS.AND.DOTS. hotmail.com> wrote in message
news:es******** ******@TK2MSFTN GP11.phx.gbl...
well either is fine though i prefer single quote to explicity distinguish
between server side string and client side.

--

Regards,

Hermit Dave
(http://hdave.blogspot.com)
"Nelson Smith" <Ne*****@hotmai l.com> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
In my java script to set the value I am using the following code

document.frmMyF orm.txtCustNo.v alue = "xxxxx"

&

document.frmMyF orm.txtCustNo.v alue = 'xxxxx'

Questions is single quote or double quote is right way coding?

Thanks,

Nelson


Nov 18 '05 #3
Either way is fine.
Really.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
"Nelson Smith" <Ne*****@hotmai l.com> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
In my java script to set the value I am using the following code

document.frmMyF orm.txtCustNo.v alue = "xxxxx"

&

document.frmMyF orm.txtCustNo.v alue = 'xxxxx'

Questions is single quote or double quote is right way coding?

Thanks,

Nelson

Nov 18 '05 #4
either is fine. it just a matter of preference. single quotes are handy when
javascript is imbeeded in html:

<button onclick="doProc ess(this,'someL iteral');">

or if the javascript outputs html which contains quotes.

document.write( '<img src="images/foo.gif">');

-- bruce (sqlwork.com)
"Nelson Smith" <Ne*****@hotmai l.com> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
In my java script to set the value I am using the following code

document.frmMyF orm.txtCustNo.v alue = "xxxxx"

&

document.frmMyF orm.txtCustNo.v alue = 'xxxxx'

Questions is single quote or double quote is right way coding?

Thanks,

Nelson

Nov 18 '05 #5
> What is the professional way of doing it?

The professional way of doing it is thus:

1. Understand the rules of HTML.
2. Know what your options are.
3. Use the method that is most appropriate at the time.
4. If neither is more appropriate, pick one.

You can take my word for it. I'm a professional. ;-)

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Nelson Smith" <Ne*****@hotmai l.com> wrote in message
news:OZ******** ******@TK2MSFTN GP15.phx.gbl...
What is the professional way of doing it?
Thanks,
Nelson

"Hermit Dave" <he************ @CAPS.AND.DOTS. hotmail.com> wrote in message
news:es******** ******@TK2MSFTN GP11.phx.gbl...
well either is fine though i prefer single quote to explicity distinguish between server side string and client side.

--

Regards,

Hermit Dave
(http://hdave.blogspot.com)
"Nelson Smith" <Ne*****@hotmai l.com> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
In my java script to set the value I am using the following code

document.frmMyF orm.txtCustNo.v alue = "xxxxx"

&

document.frmMyF orm.txtCustNo.v alue = 'xxxxx'

Questions is single quote or double quote is right way coding?

Thanks,

Nelson



Nov 18 '05 #6
hahah very true. as bruce said sometimes you have to use both. specially
when embedding javascript in html

--

Regards,

Hermit Dave
(http://hdave.blogspot.com)
"Kevin Spencer" <ks******@takem pis.com> wrote in message
news:eZ******** ******@TK2MSFTN GP15.phx.gbl...
What is the professional way of doing it?


The professional way of doing it is thus:

1. Understand the rules of HTML.
2. Know what your options are.
3. Use the method that is most appropriate at the time.
4. If neither is more appropriate, pick one.

You can take my word for it. I'm a professional. ;-)

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Nelson Smith" <Ne*****@hotmai l.com> wrote in message
news:OZ******** ******@TK2MSFTN GP15.phx.gbl...
What is the professional way of doing it?
Thanks,
Nelson

"Hermit Dave" <he************ @CAPS.AND.DOTS. hotmail.com> wrote in message
news:es******** ******@TK2MSFTN GP11.phx.gbl...
well either is fine though i prefer single quote to explicity

distinguish between server side string and client side.

--

Regards,

Hermit Dave
(http://hdave.blogspot.com)
"Nelson Smith" <Ne*****@hotmai l.com> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
> In my java script to set the value I am using the following code
>
> document.frmMyF orm.txtCustNo.v alue = "xxxxx"
>
> &
>
> document.frmMyF orm.txtCustNo.v alue = 'xxxxx'
>
>
>
> Questions is single quote or double quote is right way coding?
>
> Thanks,
>
> Nelson
>
>



Nov 18 '05 #7
Well, you CAN escape double-quotes. But it is more time-consuming to do so.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Hermit Dave" <he************ @CAPS.AND.DOTS. hotmail.com> wrote in message
news:OW******** ******@TK2MSFTN GP15.phx.gbl...
hahah very true. as bruce said sometimes you have to use both. specially
when embedding javascript in html

--

Regards,

Hermit Dave
(http://hdave.blogspot.com)
"Kevin Spencer" <ks******@takem pis.com> wrote in message
news:eZ******** ******@TK2MSFTN GP15.phx.gbl...
What is the professional way of doing it?


The professional way of doing it is thus:

1. Understand the rules of HTML.
2. Know what your options are.
3. Use the method that is most appropriate at the time.
4. If neither is more appropriate, pick one.

You can take my word for it. I'm a professional. ;-)

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Nelson Smith" <Ne*****@hotmai l.com> wrote in message
news:OZ******** ******@TK2MSFTN GP15.phx.gbl...
What is the professional way of doing it?
Thanks,
Nelson

"Hermit Dave" <he************ @CAPS.AND.DOTS. hotmail.com> wrote in message news:es******** ******@TK2MSFTN GP11.phx.gbl...
> well either is fine though i prefer single quote to explicity

distinguish
> between server side string and client side.
>
> --
>
> Regards,
>
> Hermit Dave
> (http://hdave.blogspot.com)
> "Nelson Smith" <Ne*****@hotmai l.com> wrote in message
> news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
> > In my java script to set the value I am using the following code
> >
> > document.frmMyF orm.txtCustNo.v alue = "xxxxx"
> >
> > &
> >
> > document.frmMyF orm.txtCustNo.v alue = 'xxxxx'
> >
> >
> >
> > Questions is single quote or double quote is right way coding?
> >
> > Thanks,
> >
> > Nelson
> >
> >
>
>



Nov 18 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
2162
by: H | last post by:
This is a question that has haunted me for quite some time. if you build a 4 tier database application where the 4th tier is the database server (MS SQL 2000), where do you build the connection string? The obvious answer is to hard code it into the middle layer and use a config file. The problem is the database application needs to be distributed to purchasing clients. Therefore, you do not know, at development, what the SQL
17
2562
by: lawrence | last post by:
How is it possible that the question "How do I detect which browser the user has" is missing from this FAQ: http://www.faqts.com/knowledge_base/index.phtml/fid/125 and is only here on this with a link to old information that suggests use of "navigator": http://developer.irt.org/script/43.htm
2
6471
by: Sean Dockery | last post by:
Which is the following is correct? a) <form ... onSubmit="return checkData()"> b) <form ... onSubmit="return checkData();"> c) <form ... onSubmit="checkData()"> d) <form ... onSubmit="checkData();">
8
3984
by: Jean-David Beyer | last post by:
I got this while reorganizing a database after doing perhaps a million INSERTs. Not the best way to populate a relation, but the most practical. Then I did a REORG and got this (looked up SQL2215N) SQL2215N SQL error sqlcode occurred while committing previous work for the database. Explanation: The user was already connected to the database specified in the Reorganize Table command. An error occurred while committing the previous work...
5
1875
by: mm nn | last post by:
Hi, I want to create a table like this: ID Autonum Datefld Date Cat Text Itm Text tCount Number
65
12628
by: Skybuck Flying | last post by:
Hi, I needed a method to determine if a point was on a line segment in 2D. So I googled for some help and so far I have evaluated two methods. The first method was only a formula, the second method was a piece of C code which turned out to be incorrect and incomplete but by modifieing it would still be usuable. The first method was this piece of text:
4
9700
by: mflll | last post by:
I am looking into the different techniques of handling arrays of edit boxes in Java Script. The first program below works fine. However, are there better ways of doing this, where the person writing the JavaScript doesn't have to pass the index in the "onChange" event name. I thought that one might be able to use "this.value" or compare this as
9
1433
by: Maximus | last post by:
wchar_t ch2 = L'\u27BA'; wchar_t ch = '\u27BA'; On Visual C++ 2003 SP1, no compiler warnings are given at all. However, ch != ch2. Which one is correct? ---
13
1270
by: =?ISO-8859-1?Q?Tom=E1s_=D3_h=C9ilidhe?= | last post by:
If you have: #define errno retrieve_errno_func() #define SUBSYSTEM_INCLUDE(subsystem, file) <subsystem/include/file> then what should happen when you do:
0
1600
by: readnlearn | last post by:
hai, i have written this below code for displaying captcha image whenever i entered incorrect uname,password in login page. for that i disable the controls of captcha like textbox,labels,button and image control in source code of designing part. and i enable those controls in an if condition which display captcha. but if i entered correct information which is in database it shouldn't navigate to the corresponding page and also if entered...
0
9689
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10495
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10248
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10032
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5469
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5597
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4148
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2942
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.