Adding a input box

241 views
Skip to first unread message

mahi

unread,
May 14, 2009, 5:09:25 AM5/14/09
to Prototype & script.aculo.us
Hi

I am newbie in prototype.js, here i am trying to add the input box it
is working in IE but not in mozilla .
pl help me ASAP...


var c =new Element('input', {'type':'text', 'id': 'var1Value' ,
'value':'var1 default value'});
$('uiElements').insert(c);

regards
mahendra varandani

rai.ashis

unread,
May 14, 2009, 8:12:57 AM5/14/09
to prototype-s...@googlegroups.com
Hi,

you can try other way to insert like....

$('uiElements').insert("<input type='text' id='idName' value='anything'/>");

it's the simple way as you are writing the code in js file so you can try this one.


You can try scriptaculous builder.js also. Here is the link

http://wiki.github.com/madrobby/scriptaculous/builder


Thanks

ColinFine

unread,
May 14, 2009, 8:46:53 AM5/14/09
to Prototype & script.aculo.us
You need to give us more information.
When you say 'not working', it might be any of:
- gives a browser error
- crashes the browser
- no visible effect
- displays the input box, but it is empty
- displays the input box, but won't let you change it
- displays the input box, but when you submit the form, it ignores the
changes you've made

and probably more possibilities I haven't thought of.

Can you see that without knowing what you mean by it, it's almost
impossible to advise you?

Also, you haven't told us what 'usElements' is.

Colin

> regards
> mahendra varandani

Miguel Beltran R.

unread,
May 14, 2009, 10:12:32 AM5/14/09
to prototype-s...@googlegroups.com
'value':'var1 default value'});


maybe no correct closing values
chage to 'value':'var1', default:'value'});


mahen

unread,
May 14, 2009, 10:54:22 AM5/14/09
to prototype-s...@googlegroups.com
Hi all

thanks  for replying..

no this is the correct value i am giving this by my own.

well ya i tried the above solutions by direct inserting the input tag as Html but still its not working in Mozilla............. Well my designer is saying there might be somewhat issue of Design Css as the positioning of that container div.... he is working on it might it workss.......... 

again thanks for reply and if you found any relative spolutions pl let me know.....


Mahendra Varandani
Software Engineer
IDes Solutions
Gurgaon
Ph-9990869026

Matt Foster

unread,
May 14, 2009, 5:09:24 PM5/14/09
to Prototype & script.aculo.us
Be sure you're doing this operation after the document has loaded.
Attempting to access/modify DOM elements before the "load" event has
fired will certainly cause issues.

window.onload = function(){
var c =new Element('input', {'type':'text', 'id': 'var1Value' ,
'value':'var1 default value'});
$('uiElements').insert(c);
}

--

http://positionabsolute.net


On May 14, 10:54 am, mahen <chiku.4...@gmail.com> wrote:
> Hi all
>
> thanks  for replying..
>
> no this is the correct value i am giving this by my own.
>
> well ya i tried the above solutions by direct inserting the input tag as
> Html but still its not working in Mozilla............. Well my designer is
> saying there might be somewhat issue of Design Css as the positioning of
> that container div.... he is working on it might it workss..........
>
> again thanks for reply and if you found any relative spolutions pl let me
> know.....
>
> Mahendra Varandani
> Software Engineer
> IDes Solutions
> Gurgaon
> Ph-9990869026
>

ColinFine

unread,
May 15, 2009, 6:47:55 AM5/15/09
to Prototype & script.aculo.us


On May 14, 3:54 pm, mahen <chiku.4...@gmail.com> wrote:
> Hi all
>
> thanks  for replying..
>
> no this is the correct value i am giving this by my own.
>
> well ya i tried the above solutions by direct inserting the input tag as
> Html but still its not working in Mozilla............. Well my designer is
> saying there might be somewhat issue of Design Css as the positioning of
> that container div.... he is working on it might it workss..........
>
You still haven't told us what you mean by 'not working'.

Colin
Reply all
Reply to author
Forward
0 new messages