Parameter passing problem

Guys,
One simple question…

I am creating some elements using javascript … Even they are working
fine as well as i am giving them name and ids… But when i click submit
button these parameters are not coming in the passing hash …
Can it happen … ? Wasted much time but no solution… May be you guyz
can help me out …

On Tue, Sep 22, 2009 at 4:18 AM, Hemant B.
[email protected] wrote:

May be you guyz can help me out …

Not without a heck of a lot more detail…


Hassan S. ------------------------ [email protected]
twitter: @hassan

Ok…

The thing is i am adding a new tailor and adding his phone number. Now
if he has more than one number then he have to create a text box himself
by clicking on add more phone number. Now If he clicked text box is
created. Even in firefox i had seen that id and names are there what i
want… But when i commit my page i mean when i add that tailor … These
javascript created elements are not passing to next page …
Hope you people got my problem … :slight_smile:

Hassan S. wrote:

On Tue, Sep 22, 2009 at 4:18 AM, Hemant B.
[email protected] wrote:

Anybody listening me … ?

Hemant B. wrote:

Ok…

The thing is i am adding a new tailor and adding his phone number. Now
if he has more than one number then he have to create a text box himself

On Sep 24, 10:28 am, Hemant B. <rails-mailing-l…@andreas-
s.net> wrote:

Anybody listening me … ?

You’re still being quite vague. In no particular order: check that the
parameters aren’t there but under a different name, check that the
fields you add are inside the form and if these fields have the same
name as existing fields on the page then make sure you understand the
info at

Fred

2009/9/24 Hemant B. [email protected]:

Thats Ok,
I am creating the elements inside the form only. I can see this in
firebug as well. Also about naming convention, I am naming them as
tailor_phone, tailor_phone0, tailor_phone1… I think these are all
different variables. Correct… And these variable names are unique to
the page. What else … ?

Have you tried copying the html out of the browser View Page source
and pasting into the w3c html validator web site? If it is not valid
html then strange things happen.

Colin

Thats Ok,
I am creating the elements inside the form only. I can see this in
firebug as well. Also about naming convention, I am naming them as
tailor_phone, tailor_phone0, tailor_phone1… I think these are all
different variables. Correct… And these variable names are unique to
the page. What else … ?

Frederick C. wrote:

You’re still being quite vague. In no particular order: check that the
parameters aren’t there but under a different name, check that the
fields you add are inside the form and if these fields have the same
name as existing fields on the page then make sure you understand the
info at
Action View Form Helpers — Ruby on Rails Guides

Fred

Colin L. wrote:
Man this validator is giving me “469 Errors, 346 warning(s)”. What crap
is this?

Have you tried copying the html out of the browser View Page source
and pasting into the w3c html validator web site? If it is not valid
html then strange things happen.

Colin

Can you paste your code?

On Sep 24, 12:19 pm, Hemant B. <rails-mailing-l…@andreas-
s.net> wrote:

Colin L. wrote:

Man this validator is giving me “469 Errors, 346 warning(s)”. What crap
is this?

It’s more likely that the validator is correct and that you have a lot
of invalid html.

Fred

2009/9/24 Hemant B. [email protected]:

Man this validator is giving me “469 Errors, 346 warning(s)”. What crap
is this?

Well you wrote it.

Colin

2009/9/24 Hemant B. [email protected]:

Man this validator is giving me “469 Errors, 346 warning(s)”. What crap
is this?

Sorry, couldn’t resist to reply with a big smile on my face :wink: hehe…

Champs,
I have following errors now after validating by w3.org :slight_smile:

My first two lines are of application is:-

And the errors are:-

Line 1, Column 121: DTD did not contain element declaration for

document type name

…/xhtml1/DTD/xhtml1-transitional.dtd">

✉

A DOCTYPE declares the version of the language used, as well as what the
root (top) element of your document will be. For example, if the top
element of your document is , the DOCTYPE declaration will look
like: “<!DOCTYPE html”.

In most cases, it is safer not to type or edit the DOCTYPE declaration
at all, and preferable to let a tool include it, or copy and paste it
from a trusted list of DTDs.

Error Line 2, Column 67: document type does not allow element “html”

here

…n" xmlns=“XHTML namespace” lang=“en”>

✉

The element named above was found in a context where it is not allowed.
This could mean that you have incorrectly nested elements – such as a
“style” element in the “body” section instead of inside “head” – or two
elements that overlap (which is not allowed).

One common cause for this error is the use of XHTML syntax in HTML
documents. Due to HTML’s rules of implicitly closed elements, this error
can create cascading effects. For instance, using XHTML’s “self-closing”
tags for “meta” and “link” in the “head” section of a HTML document may
cause the parser to infer the end of the “head” section and the
beginning of the “body” section (where “link” and “meta” are not
allowed; hence the reported error).

Error Line 4, Column 70: end tag for “meta” omitted, but OMITTAG NO

was specified

… content="text/html; charset=UTF-…

✉

You may have neglected to close an element, or perhaps you meant to
“self-close” an element, that is, ending it with “/>” instead of “>”.

Info Line 4, Column 2: start tag was here

---------------

There are also some more errors for label.
In source code … I mean when i view page source labels are of type:-
td>

FRCA

And this code is also giving me error… The error is-

reference to non-existent ID “FRCA”

                    <label for="FRCA">

✉

This error can be triggered by:

* A non-existent input, select or textarea element
* A missing id attribute
* A typographical error in the id attribute

Try to check the spelling and case of the id you are referring to.

Can you guyz tell me why these errors are coming …

Martijn van Rheenen wrote:

2009/9/24 Hemant B. [email protected]:

First of all, as XML is case sensitive, I would change this:

<!DOCTYPE HTML PUBLIC...

to this:

<!DOCTYPE html PUBLIC...

See what errors are still found after that.
(btw: this is more a html / xml related question than a
RubyOnRails-related
issue, just to be clear)

Martijn van Rheenen wrote:

Yups this was one issue … Lot of erros gone … But still left from
above code i had written …
Declared an form like this also giving me error …
<% form_tag ‘/doctors/create’, :method => ‘post’ do -%>
<% end %>
Why so champs…

First of all, as XML is case sensitive, I would change this:

<!DOCTYPE HTML PUBLIC...

to this:

<!DOCTYPE html PUBLIC...

See what errors are still found after that.
(btw: this is more a html / xml related question than a
RubyOnRails-related
issue, just to be clear)

2009/9/24 Hemant B. [email protected]:

Â

And this code is also giving me error… The error is-

reference to non-existent ID “FRCA”

           Â

The label for=“FRCA” is expecting to find an object with id FRCA that
this is the label for.
Is it usual to have an input inside a label?
Did you mean
FRCA
<input … />

Colin

On Sep 25, 7:00 am, Hemant B. [email protected]
wrote:


XML Parsing Error: xmlParseEntityRef: no name
…=“adddynamicBox_Mon” id=“adddynamicBox_Mon” value=“Add Schedule”
onclick="add…

I had given name also rit… Then why error is coming…

Also i am passing a name to javascript function which has “&” in it. Is
there any way to decode it as well.

without seeing the generated html it is only a guess but & characters
need to be escaped.

F

Ok thanks a lot for your replies,
Just about to finish it with a big smile on my face …:slight_smile:

<input type=“button” name=“adddynamicBox_<%= day %>”
id=“adddynamicBox_<%= day %>” value=“Add Schedule”
onclick=“addScheduleRow(’<%= day %>’, <%= index %>, [<%=
time_slot_array.join(”, “) %>], [<%= clinic_id_array.join(”, “) %>],
[’<%= clinic_name_array.join(”’, ‘") %>’]) " />

And this line is giving me error:-

XML Parsing Error: xmlParseEntityRef: no name
…=“adddynamicBox_Mon” id=“adddynamicBox_Mon” value=“Add Schedule”
onclick="add…

I had given name also rit… Then why error is coming…

Also i am passing a name to javascript function which has “&” in it. Is
there any way to decode it as well.

Did you mean
FRCA
<input … />

Colin


<input type=“button” name=“adddynamicBox_Mon”
id=“adddynamicBox_Mon” value=“Add Schedule”
onclick="addScheduleRow(‘Mon’, 1, [700, 730, 800, 830, 900, 930, 1000,
1030, 1100, 1130, 1200, 1230, 1300, 1330, 1400, 1430, 1500, 1530, 1600,
1630, 1700, 1730, 1800, 1830, 1900, 1930, 2000, 2030, 2100], [8, 9, 12,
6, 10, 1, 11, 2, 5, 13, 3, 7, 4], [‘Crowns & Ridges’, ‘Millenium’] />

This is HTML which is generated by the above written code …
Giving me error that–And this line is giving me error:-

XML Parsing Error: xmlParseEntityRef: no name
…=“adddynamicBox_Mon” id=“adddynamicBox_Mon” value=“Add Schedule”
onclick="add…

Can we see the html please, with a bit either side of the error.

Colin

2009/9/25 Hemant B. [email protected]:

         <input type="button" name="adddynamicBox_Mon" id="adddynamicBox_Mon" value="Add Schedule" onclick="addScheduleRow('Mon', 1, [700, 730, 800, 830, 900, 930, 1000, 1030, 1100, 1130, 1200, 1230, 1300, 1330, 1400, 1430, 1500, 1530, 1600, 1630, 1700, 1730, 1800, 1830, 1900, 1930, 2000, 2030, 2100], [8, 9, 12, 6, 10, 1, 11, 2, 5, 13, 3, 7, 4], ['Crowns & Ridges', 'Millenium'] />         </td> </blockquote> <p>Is there )" missing?</p> <p>Colin</p>