Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

function submits 2 values 1

Status
Not open for further replies.

josephjoe

Programmer
Jul 5, 2007
3
US
Textbox Values: Car= Red , Pro= 1236


I am looking to display the result like this: red,1236


function makeCheckBox(cell)
{
cell.innerHTML = '<input id="sbt" type="submit" name="Submit" value="Ship" onclick="blnk(car.value+pro.value)" />'
}
Display Like: Red1236

function makeCheckBox(cell)
{
cell.innerHTML = '<input id="sbt" type="submit" name="Submit" value="Ship" onclick="blnk(car.value +','+ pro.value)" />'
}
Display Like: I get an object error.


the blnk function is:
function blnk(str)
{
alert(str)
}



I have tried pretty much everything, with no luck, Anybody have any idea's

I need it to pass the values separated with a comma.

Red,1236
 
If you're going to put single quotes in a string that is delimited by single quotes then you have to escape them. Try this:
Code:
cell.innerHTML = '<input id="sbt" type="submit" name="Submit" value="Ship" onclick="blnk(car.value +[red]\',\'[/red]+ pro.value)" />'


Adam
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top