Jump to content

Get Element By Id In Ff


gar onn
 Share

Recommended Posts

i have

function Request(el,url) {var query=""; var inputs=el.getElementsByTagName("input"); for(var i = 0; i < inputs.length; i++){ switch(inputs.type) { case "checkbox": if(inputs.checked==true){query+=inputs.name+"=on";}else{query+=inputs.name+"="} break; case "radio": if(inputs.checked==true){query+=inputs.name+"="+inputs.value;} break; case "hidden": query+=inputs.name+"="+inputs.value; break; case "password": query+=inputs.name+"="+inputs.value; break; case "text": query+=inputs.name+"="+inputs.value; break; case "textarea": query+=inputs.name+"="+inputs.value; break; case "submit": query+="submit"; break; default: query+=inputs.name+"="+inputs.value; prompt("Error","java script:alert('ERROR While handeling POSTsubmitrequest: \nname="+inputs.name+"\nid="+inputs.id+"\nvalue="+inputs.value+"')"); } query+="&"; }requestOut(query,url);}
if run this code by foloing (eval) script:
$(document).ready(function(){$('#user_start_chose_form_submit').click(function () {Request($('#user_start_chose_form'),'user_start');});});

whats wrong??but fire bug says there is a problem at the bolt line

Link to comment
Share on other sites

Yes it says that inputs is an undifinted element
It shouldn't give that error for the bold line, that's where you're defining it. It doesn't give errors when you try to define an undefined variable, that's normal. Are you using console.log to see what things are?
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...